/* ============================================================
   BASE & LAYOUT
   ============================================================ */
* {
    -webkit-tap-highlight-color: transparent;
}

body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    color: #334155;
    min-height: 100vh;
}

.form-container {
    min-height: 100vh;
    padding: 1.25rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   CARD & LAYOUT
   ============================================================ */
.card {
    width: 100%;
    max-width: 720px;
    height: auto;
    max-height: 95vh;
    overflow-y: auto;
    background: white;
    border-radius: 1.25rem;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 15px 30px -8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: cardEnter 0.5s ease-out;
}

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

/* ============================================================
   HEADER
   ============================================================ */
.card-header {
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.header-logo {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.4);
}

.header-logo img {
    width: 1.3rem;
    height: 1.3rem;
    object-fit: contain;
}

.header-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.5px;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-section {
    padding: 0.875rem 1.75rem;
}

.progress-bar-container {
    height: 5px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #1e3a8a 0%, #1e40af 100%);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(30, 58, 138, 0.6);
}

.progress-label {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 0.375rem;
    font-weight: 600;
}

/* ============================================================
   FORM FIELDS & INPUTS
   ============================================================ */
.form-content {
    padding: 1.5rem 1.75rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.875rem;
}

.form-field {
    position: relative;
    display: flex;
    flex-direction: column;
}

.form-field.col-span-2 {
    grid-column: 1 / -1;
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.75rem 0.875rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: white;
    font-family: inherit;
    color: #1e293b;
}

.form-input::placeholder,
.form-select::placeholder {
    color: transparent;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 
        0 0 0 3px rgba(30, 64, 175, 0.1),
        inset 0 0 0 0.5px #1e40af;
    background: white;
}

.form-input.valid {
    border-color: #10b981;
    background: #f0fdf4;
}

.form-input.invalid {
    border-color: #ef4444;
    background: #fef2f2;
}

.form-input.valid:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-input.invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.form-label .required {
    color: #ef4444;
}

/* ============================================================
   VALIDATION FEEDBACK
   ============================================================ */
.validation-feedback {
    display: none;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    align-items: center;
    gap: 0.375rem;
    animation: slideDown 0.2s ease-out;
}

.validation-feedback.show {
    display: flex;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.validation-feedback.error {
    color: #dc2626;
}

.validation-feedback.success {
    color: #059669;
}

.validation-icon {
    font-size: 0.7rem;
    flex-shrink: 0;
}

/* ============================================================
   PROFILE PICTURE
   ============================================================ */
.profile-section {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    padding-top: 0.25rem;
}

.profile-upload-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.9rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px dashed #1e40af;
    border-radius: 0.625rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e40af;
}

.profile-upload-btn:hover {
    background: linear-gradient(135deg, #e0f2fe 0%, #cff0ff 100%);
    border-color: #1e3a8a;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.2);
}

.profile-preview {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.profile-image {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #1e40af;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.profile-remove {
    width: 1.4rem;
    height: 1.4rem;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid white;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
    position: absolute;
    right: -0.5rem;
    bottom: -0.5rem;
}

.profile-remove:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* ============================================================
   PASSWORD TOGGLE
   ============================================================ */
.password-toggle-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    padding: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle-btn:hover {
    color: #1e40af;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.button-section {
    margin-top: 1.25rem;
    display: flex;
    gap: 0.75rem;
}

.submit-btn,
.reset-btn {
    flex: 1;
    padding: 0.85rem;
    border: none;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    letter-spacing: 0.5px;
}

.submit-btn {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.4);
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 58, 138, 0.5);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.reset-btn {
    background: #f1f5f9;
    color: #475569;
    border: 1.5px solid #e2e8f0;
}

.reset-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.spinner {
    display: none;
    width: 0.85rem;
    height: 0.85rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.submit-btn.loading .spinner {
    display: block;
}

.submit-btn.loading .button-text {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    margin-top: 0.6rem;
    padding: 0.9rem 1.1rem;
    border-radius: 0.625rem;
    background: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 260px;
    max-width: 380px;
    animation: toastEnter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

@keyframes toastEnter {
    from {
        opacity: 0;
        transform: translateX(400px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastExit {
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}

.toast.exiting {
    animation: toastExit 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast.success .toast-icon {
    color: #10b981;
}

.toast.error .toast-icon {
    color: #ef4444;
}

.toast.warning .toast-icon {
    color: #f59e0b;
}

.toast.info .toast-icon {
    color: #1e40af;
}

.toast-content {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
}

.toast-title {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.875rem;
}

.toast-message {
    font-size: 0.75rem;
    color: #64748b;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    transition: all 0.2s;
}

.toast-close:hover {
    color: #475569;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-container {
        padding: 1rem;
    }

    .card-header {
        padding: 1.25rem;
    }

    .form-content {
        padding: 1.25rem;
    }

    .header-title {
        font-size: 1.2rem;
    }

    .profile-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-upload-btn {
        width: 100%;
        justify-content: center;
    }

    .button-section {
        flex-direction: column;
    }

    .submit-btn,
    .reset-btn {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .toast-container {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
    }

    .toast {
        min-width: auto;
        max-width: none;
    }
}
