

.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 1rem;
}

.auth-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.auth-modal {
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.4), 0 0 1px rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: saturate(180%) blur(30px);
    -webkit-backdrop-filter: saturate(180%) blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 3.5rem;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(40px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.auth-modal-overlay.active .auth-modal {
    transform: scale(1) translateY(0);
}

.auth-modal-header {
    padding: 3rem 3rem 2.5rem;
    text-align: center;
    position: relative;
}

.auth-modal-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    color: #9ca3af;
    z-index: 10;
}

.auth-modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #1d1d1f;
}

.auth-modal-icon {
    width: 5rem;
    height: 5rem;
    background: #000000;
    border-radius: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.auth-modal-icon i,
.auth-modal-icon svg {
    width: 2.5rem;
    height: 2.5rem;
    color: white;
}

.auth-modal-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: #000000;
    margin-bottom: 0.75rem;
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.auth-modal-subtitle {
    font-size: 1.125rem;
    color: #6b7280;
    font-weight: 500;
    display: none;
}

.auth-modal-body {
    padding: 0 3rem 3rem;
}

.auth-form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.auth-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.auth-form-icon {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.5rem;
    height: 1.5rem;
    color: #9ca3af;
    pointer-events: none;
}

.auth-form-input {
    width: 100%;
    padding: 1.5rem;
    font-size: 1.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.6);
    color: #000000;
    transition: all 0.3s ease;
    font-family: inherit;
    font-weight: 500;
}

.auth-form-input.has-icon {
    padding-left: 4rem;
}

.auth-form-input:focus {
    outline: none;
    background: #ffffff;
    border-color: #0066cc;
    box-shadow: 0 0 0 5px rgba(0, 102, 204, 0.1);
}

.auth-form-input.error {
    border-color: #ef4444;
    background: #fee2e2;
}

.auth-form-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.auth-form-input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0px 1000px white inset !important;
}

.auth-code-inputs {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.auth-code-input {
    width: 100%;
    height: 4rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.6);
    color: #000000;
    transition: all 0.3s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    padding: 0;
}

.auth-code-input:focus {
    outline: none;
    border-color: #0066cc;
    background: #ffffff;
    box-shadow: 0 0 0 5px rgba(0, 102, 204, 0.12);
    transform: translateY(-2px);
}

.auth-code-input.filled {
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.06);
}

.auth-code-input.error {
    border-color: #ef4444;
    background: #fee2e2;
    animation: shake 0.4s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.auth-error-message {
    display: none;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fca5a5;
    border-radius: 1rem;
    color: #dc2626;
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.1);
}

.auth-error-message.active {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideDown 0.3s ease;
}

.auth-error-message.active::before {
    content: "⚠";
    font-size: 1.25rem;
    flex-shrink: 0;
}

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

.auth-success-message {
    display: none;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #86efac;
    border-radius: 1rem;
    color: #16a34a;
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.1);
}

.auth-success-message.active {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideDown 0.3s ease;
}

.auth-success-message.active::before {
    content: "✓";
    font-size: 1.25rem;
    flex-shrink: 0;
    font-weight: 700;
}

.auth-btn-primary {
    width: 100%;
    padding: 1.5rem;
    background: #000000;
    color: white;
    border: none;
    border-radius: 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-btn-primary:hover:not(:disabled) {
    background: #1f2937;
    transform: scale(0.98);
}

.auth-btn-primary:active:not(:disabled) {
    transform: scale(0.97);
}

.auth-btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

.auth-btn-primary.blue {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.2);
}

.auth-btn-primary.blue:hover:not(:disabled) {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

.auth-btn-primary.green {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    box-shadow: 0 10px 30px rgba(34, 197, 94, 0.1);
}

.auth-btn-primary.green:hover:not(:disabled) {
    background: linear-gradient(135deg, #15803d 0%, #166534 100%);
}

.auth-btn-secondary {
    width: 100%;
    padding: 1.125rem;
    background: rgba(0, 0, 0, 0.04);
    color: #1d1d1f;
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: 1rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    letter-spacing: -0.01em;
    margin-top: 0.75rem;
}

.auth-btn-secondary:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.auth-text-btn {
    background: none;
    border: none;
    color: #2563eb;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0.75rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.auth-text-btn:hover {
    text-decoration: underline;
}

.auth-helper-text {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.125rem;
    color: #6b7280;
    line-height: 1.5;
    font-weight: 500;
}

.auth-helper-text strong {
    color: #000000;
    font-weight: 700;
}

.auth-email-display {
    color: #000000;
    font-weight: 700;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: #86868b;
    font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #d2d2d7;
}

.auth-divider span {
    padding: 0 1rem;
}

.auth-switch-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    color: #374151;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.auth-switch-link:hover {
    background: rgba(37, 99, 235, 0.04);
    border-color: #2563eb;
    color: #2563eb;
    transform: translateY(-1px);
}

.auth-switch-link i {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.3s ease;
}

.auth-switch-link:hover i {
    transform: scale(1.1);
}

.auth-password-toggle {
    position: relative;
}

.auth-password-toggle-btn {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    z-index: 10;
}

.auth-password-toggle-btn:hover {
    color: #000000;
}

.auth-password-toggle-btn i {
    width: 1.5rem;
    height: 1.5rem;
}

.auth-countdown {
    font-size: 1rem;
    color: #9ca3af;
    text-align: center;
    margin-top: 1rem;
    font-weight: 500;
}

.auth-countdown.active {
    color: #2563eb;
}

.auth-resend-btn {
    width: 100%;
    margin-top: 1rem;
    padding: 1rem;
    background: none;
    border: none;
    color: #2563eb;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-resend-btn:hover {
    text-decoration: underline;
}

.auth-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.auth-steps {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.auth-step {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d2d2d7;
    transition: all 0.3s ease;
}

.auth-step.active {
    background: #0066cc;
    width: 24px;
    border-radius: 4px;
}

@media (max-width: 640px) {
    .auth-modal {
        border-radius: 2.5rem;
        max-height: 95vh;
        padding: 0;
    }
    
    .auth-modal-header {
        padding: 2.5rem 1.5rem 2rem;
    }
    
    .auth-modal-body {
        padding: 0 1.5rem 2.5rem;
    }
    
    .auth-modal-icon {
        width: 4rem;
        height: 4rem;
        margin-bottom: 1.5rem;
        border-radius: 1rem;
    }
    
    .auth-modal-icon i,
    .auth-modal-icon svg {
        width: 2rem;
        height: 2rem;
    }
    
    .auth-modal-title {
        font-size: 1.875rem;
    }
    
    .auth-modal-subtitle {
        font-size: 1rem;
    }
    
    .auth-code-inputs {
        gap: 0.375rem;
    }
    
    .auth-code-input {
        height: 3.5rem;
        font-size: 1.25rem;
    }
    
    .auth-form-input {
        padding: 1.25rem;
        font-size: 1rem;
    }
    
    .auth-form-input.has-icon {
        padding-left: 3.5rem;
    }
    
    .auth-btn-primary {
        padding: 1.25rem;
        font-size: 1.125rem;
    }
    
    .auth-info-box {
        font-size: 0.875rem;
        padding: 0.875rem 1rem;
    }
    
    .auth-helper-text {
        font-size: 1rem;
    }
    
    .auth-modal-close {
        width: 36px;
        height: 36px;
        top: 1.5rem;
        right: 1.5rem;
    }
    
    .auth-back-btn {
        top: 1.5rem;
        left: 1.5rem;
        width: 36px;
        height: 36px;
    }
    
    .auth-back-btn i,
    .auth-back-btn svg {
        width: 1.25rem;
        height: 1.25rem;
    }
    
    .auth-switch-link {
        padding: 0.875rem 1.25rem;
        font-size: 0.9375rem;
    }
    
    .auth-switch-link i {
        width: 1.125rem;
        height: 1.125rem;
    }
}

.auth-modal::-webkit-scrollbar {
    width: 6px;
}

.auth-modal::-webkit-scrollbar-track {
    background: transparent;
}

.auth-modal::-webkit-scrollbar-thumb {
    background: #d2d2d7;
    border-radius: 3px;
}

.auth-modal::-webkit-scrollbar-thumb:hover {
    background: #86868b;
}

.auth-step-content {
    display: none;
    opacity: 0;
}

.auth-step-content.active {
    display: block;
    animation: appleIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.auth-skip-btn {
    display: block;
    width: 100%;
    text-align: center;
    color: #9ca3af;
    font-size: 1rem;
    font-weight: 700;
    padding: 1rem;
    margin-top: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.auth-skip-btn:hover {
    color: #000000;
}

.auth-back-btn {
    position: absolute;
    top: 2rem;
    left: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: #9ca3af;
    background: transparent;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.auth-back-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #000000;
}

.auth-back-btn i,
.auth-back-btn svg {
    width: 1.5rem;
    height: 1.5rem;
}

.auth-info-box {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    border-radius: 1rem;
    font-size: 0.875rem;
    color: #1e40af;
    margin-bottom: 1.5rem;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.auth-info-box i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 0.125rem;
    color: #2563eb;
}

.auth-info-box strong {
    font-weight: 700;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 1rem 0.5rem 0.5rem;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-weight: 600;
    font-size: 0.875rem;
    color: #1d1d1f;
}

.user-menu-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.user-menu-chevron {
    width: 16px;
    height: 16px;
    color: #86868b;
    transition: transform 0.3s ease;
}

.user-menu-btn.active .user-menu-chevron {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    min-width: 240px;
    background: white;
    border-radius: 1.25rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
    overflow: hidden;
}

.user-dropdown.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.user-dropdown-header {
    padding: 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: linear-gradient(180deg, #fbfbfd 0%, #ffffff 100%);
}

.user-dropdown-email {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 0.25rem;
    word-break: break-all;
}

.user-dropdown-role {
    font-size: 0.75rem;
    color: #86868b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.user-dropdown-menu {
    padding: 0.5rem;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1d1d1f;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.user-dropdown-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.user-dropdown-item i {
    width: 18px;
    height: 18px;
    color: #86868b;
}

.user-dropdown-item.danger {
    color: #ff3b30;
}

.user-dropdown-item.danger i {
    color: #ff3b30;
}

.user-dropdown-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    margin: 0.5rem 0;
}

@media (max-width: 640px) {
    .user-menu-btn {
        padding: 0.375rem 0.75rem 0.375rem 0.375rem;
        gap: 0.5rem;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    
    .user-menu-text {
        display: none;
    }
    
    .user-dropdown {
        right: -1rem;
        min-width: 220px;
    }
}

.change-password-modal {
    display: none;
}

.change-password-modal.active {
    display: block;
}
