/* =========================================================================
   AKADEMIA MATEMATYKI - STYLE FORMULARZA ZGŁOSZENIOWEGO
   ========================================================================= */

#am-form-container {
    max-width: 820px;
    margin: 40px auto;
    padding: 35px 40px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1e293b;
    box-sizing: border-box;
}

#am-form-container * {
    box-sizing: border-box;
}

/* Nagłówki sekcji */
#am-form-container h3 {
    font-size: 26px;
    font-weight: 700;
    color: #0f172a;
    margin-top: 0;
    margin-bottom: 25px;
    text-align: center;
    border-bottom: 3px solid #e2e8f0;
    padding-bottom: 15px;
}

#am-form-container .am-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #0284c7;
    margin: 30px 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

#am-form-container .am-section-title::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 18px;
    background-color: #0284c7;
    border-radius: 2px;
}

/* Siatka pól (Grid System) */
.am-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 20px;
}

.am-form-grid .am-full-width {
    grid-column: span 2;
}

/* Grupa pojedynczego pola */
.am-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.am-form-group label.am-label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.am-form-group label.am-label span.req {
    color: #ef4444;
}

/* Style pól tekstowych, email i select */
#am-zapisy-form input[type="text"],
#am-zapisy-form input[type="email"],
#am-zapisy-form select {
    width: 100%;
    height: 46px;
    padding: 10px 14px;
    font-size: 14px;
    color: #0f172a;
    background-color: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
    outline: none;
}

#am-zapisy-form select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2064748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Stany Focus i Hover dla pól */
#am-zapisy-form input[type="text"]:hover,
#am-zapisy-form input[type="email"]:hover,
#am-zapisy-form select:hover {
    border-color: #94a3b8;
    background-color: #ffffff;
}

#am-zapisy-form input[type="text"]:focus,
#am-zapisy-form input[type="email"]:focus,
#am-zapisy-form select:focus {
    border-color: #0284c7;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.15);
}

/* =========================================================================
   CUSTOMOWE CHECKBOXY
   ========================================================================= */

.am-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.am-checkbox-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background-color: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    user-select: none;
}

.am-checkbox-item:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

/* Ukrycie domyślnego checkboxa */
.am-checkbox-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

/* Customowy kwadrat checkboxa */
.am-custom-checkbox {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    border: 2px solid #94a3b8;
    border-radius: 5px;
    background-color: #ffffff;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ptaszek (fajka) wewnątrz checkboxa */
.am-custom-checkbox::after {
    content: "";
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.15s ease-in-out;
}

/* Stan zaznaczony (Checked) */
.am-checkbox-item input[type="checkbox"]:checked ~ .am-custom-checkbox {
    background-color: #0284c7;
    border-color: #0284c7;
}

.am-checkbox-item input[type="checkbox"]:checked ~ .am-custom-checkbox::after {
    transform: rotate(45deg) scale(1);
}

.am-checkbox-item input[type="checkbox"]:checked + .am-checkbox-text {
    color: #0f172a;
}

.am-checkbox-item input[type="checkbox"]:focus ~ .am-custom-checkbox {
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25);
}

.am-checkbox-text {
    font-size: 13px;
    line-height: 1.5;
    color: #334155;
}

/* Przycisk wysyłania */
.am-submit-container {
    margin-top: 30px;
    text-align: center;
}

#am-zapisy-form button[type="submit"] {
    width: 100%;
    max-width: 320px;
    height: 50px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
    transition: all 0.2s ease-in-out;
}

#am-zapisy-form button[type="submit"]:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.4);
    transform: translateY(-1px);
}

#am-zapisy-form button[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

/* RWD - Zmiany dla urządzeń mobilnych */
@media (max-width: 640px) {
    #am-form-container {
        padding: 20px;
        margin: 15px auto;
        border-radius: 12px;
    }

    .am-form-grid {
        grid-template-columns: 1fr;
    }

    .am-form-grid .am-full-width {
        grid-column: span 1;
    }

    #am-zapisy-form button[type="submit"] {
        max-width: 100%;
    }
}

/* =========================================================================
   SUCCESS MODAL
   ========================================================================= */
.am-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6); /* Ciemne tło z przezroczystością */
    backdrop-filter: blur(5px); /* Efekt rozmycia tła */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    animation: amFadeIn 0.3s forwards ease-out;
}

.am-modal-box {
    background: #ffffff;
    width: 90%;
    max-width: 450px;
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(30px);
    opacity: 0;
    animation: amSlideUp 0.4s forwards cubic-bezier(0.16, 1, 0.3, 1);
    animation-delay: 0.1s;
}

.am-modal-icon {
    width: 72px;
    height: 72px;
    background-color: #dcfce3;
    color: #16a34a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
}

.am-modal-icon svg {
    width: 36px;
    height: 36px;
}

.am-modal-box h2 {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
}

.am-modal-box p {
    margin: 0 0 10px 0;
    font-size: 15px;
    color: #475569;
    line-height: 1.6;
}

.am-btn-close {
    margin-top: 25px;
    background: #f1f5f9;
    color: #334155;
    border: none;
    padding: 12px 30px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.am-btn-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Animacje wejścia */
@keyframes amFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes amSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}