/* ========================================
    🎨 GŁÓWNE STYLE KONTENERA
======================================== */
.ios-container {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: 16px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 📐 Automatyczne marginesy między sekcjami wewnątrz kontenera */
.ios-container > *:not(:last-child) {
    margin-bottom: 16px;
}

/* ✅ Dodaj spacing pomiędzy kontenerami (poza ostatnim) */
.ios-container:not(:last-child) {
    margin-bottom: 16px;
}

@media (min-width: 768px) {
    .ios-container {
        max-width: 720px;
    }
}

.ios-form-spaced {
    margin-bottom: 24px;
}

/* ========================================
    🧾 ETYKIETY I NAGŁÓWKI
======================================== */
.ios-label {
    display: block;
    margin: 16px 0 6px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

/* ========================================
    🧩 POLA FORMULARZA (inputy, textarea, selecty)
======================================== */
.ios-input,
textarea.ios-input,
select.ios-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 12px;
    background: #fff;
    outline: none;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s ease-in-out;
}

.ios-input:focus,
textarea.ios-input:focus,
select.ios-input:focus {
    border-color: #007aff;
}

/* SELECT z ikonką strzałki */
select.ios-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg fill='%23666' height='18' viewBox='0 0 24 24' width='18' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

/* ========================================
    ✅ ALERTY I KOMUNIKATY
======================================== */
.ios-alert {
    margin-top: 14px;
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
}
.ios-alert.success { background-color: #e6fbe8; color: #218838; }
.ios-alert.error   { background-color: #fdecea; color: #cc0000; }
.ios-alert.warning { background-color: #fff4e5; color: #ed6c02; }
.ios-alert.info    { background-color: #e7f3ff; color: #0277bd; }

/* ========================================
    📋 CHECKBOXY GRUPOWE
======================================== */
.ios-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}
.ios-checkbox-group label {
    background: #f1f1f1;
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    cursor: pointer;
}
.ios-checkbox-group input[type="checkbox"] {
    margin-right: 6px;
}

/* ========================================
    🔘 PRZYCISKI
======================================== */
.ios-button,
.ios-button-primary,
.ios-button-danger,
.ios-button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s ease-in-out;
    text-align: center;
    text-decoration: none;
    width: 100%;
}

/* ✅ WYMUSZ blokowy wygląd dla <a> przycisków */
a.ios-button,
a.ios-button-primary,
a.ios-button-danger,
a.ios-button-secondary {
    display: block;
}

/* 🔵 Główny przycisk */
.ios-button-primary {
    background-color: #007aff;
    color: white;
    margin-top: 24px;
}
.ios-button-primary:hover {
    background-color: #005fce;
}

/* 🔴 Przycisk niebezpieczny */
.ios-button-danger {
    background-color: #ff3b30;
    color: white;
}
.ios-button-danger:hover {
    background-color: #d1271c;
}

/* ⚪ Przycisk drugorzędny */
.ios-button-secondary {
    background-color: #f1f1f1;
    color: #333;
}
.ios-button-secondary:hover {
    background-color: #e1e1e1;
}

/* Inline button (np. logout) */
.ios-button-inline {
    width: auto !important;
    margin-top: 0 !important;
}

/* 🟩 Kompaktowe przyciski dla mobile */
.ios-button-compact {
    margin-top: 12px !important;
    margin-bottom: 8px !important;
}

/* ========================================
    🔃 GRUPA PRZYCISKÓW
======================================== */
.ios-button-group {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    justify-content: space-between;
}

/* ========================================
    🔐 ZAKŁADKI LOGOWANIA
======================================== */
.ios-tabs {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 16px;
}
.ios-tab {
    padding: 10px;
    font-size: 14px;
    background: #f1f1f1;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.ios-tabs .ios-tab.active {
    background-color: #007aff;
    color: #fff;
}
.ios-tab-content {
    display: none;
}
.ios-tab-content.active {
    display: block;
}
.ios-tab-content.fade {
    transition: opacity 0.3s ease;
    opacity: 0;
}
.ios-tab-content.fade.active {
    opacity: 1;
}

/* ========================================
    🚪 WYLOGOWANIE
======================================== */
.ios-logout-box {
    text-align: center;
    margin-top: 20px;
}

/* ========================================
    📱 RESPONSYWNOŚĆ
======================================== */
@media (max-width: 480px) {
    .ios-container {
        padding: 12px;
    }

    .ios-button,
    .ios-button-primary {
        padding: 12px 10px;
        font-size: 14px;
        margin-top: 16px;
        margin-bottom: 10px;
    }

    .ios-button-group {
        flex-direction: column;
        gap: 10px;
    }

    .ios-button-compact {
        margin-top: 12px !important;
        margin-bottom: 8px !important;
    }
}

/* ========================================
    📂 OBSŁUGA FORMULARZY - toggle
======================================== */
#formularze-wrapper {
    display: none;
    margin-top: 20px;
}
#formularze-wrapper.active {
    display: block;
}
