/* forms.css - Unified Styles for Authentication Forms */

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== LAYOUT ===== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.auth-wrapper {
    width: 100%;
    max-width: 420px;
}

/* ===== CARD ===== */
.auth-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    transition: var(--transition);
}

.auth-card:hover {
    box-shadow: var(--shadow-xl), 0 25px 50px -12px rgba(0, 0, 0, 0.1);
}

/* ===== HEADER ===== */
.auth-header {
    padding: 2.5rem 2.5rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--gray-100);
}

.auth-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 1.75rem;
    box-shadow: var(--shadow);
}

.auth-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.auth-subtitle {
    color: var(--gray-500);
    font-size: 0.9375rem;
}

/* ===== FORM ===== */
.auth-form {
    padding: 2.5rem;
}

/* ===== FORM GROUPS ===== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    line-height: 1.25rem;
}

.form-label.required::after {
    content: " *";
    color: var(--error);
}

/* ===== INPUTS ===== */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    padding-right: 3rem;
    font-size: 0.9375rem;
    line-height: 1.25rem;
    color: var(--gray-900);
    background-color: white;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    transition: var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.form-input.error {
    border-color: var(--error);
}

.form-input.success {
    border-color: var(--success);
}

.input-icon {
    position: absolute;
    right: 1rem;
    color: var(--gray-400);
    pointer-events: none;
}

.input-action {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.25rem;
    transition: var(--transition);
}

.input-action:hover {
    color: var(--gray-700);
}

.input-action:active {
    transform: scale(0.95);
}

/* ===== VALIDATION ===== */
.input-feedback {
    display: block;
    font-size: 0.75rem;
    margin-top: 0.375rem;
    line-height: 1rem;
}

.input-feedback.error {
    color: var(--error);
}

.input-feedback.success {
    color: var(--success);
}

.input-feedback.info {
    color: var(--gray-500);
}

/* ===== CHECKBOX & REMEMBER ME ===== */
.remember-forgot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-input {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    border: 1px solid var(--gray-300);
    background-color: white;
    cursor: pointer;
    transition: var(--transition);
}

.checkbox-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkbox-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    cursor: pointer;
    user-select: none;
}

.forgot-link {
    font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.forgot-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.25rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    user-select: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

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

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--gray-200);
}

.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* ===== MESSAGES ===== */
.message {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    display: none;
}

.message.error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--error);
    display: block;
}

.message.success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: var(--success);
    display: block;
}

.message.info {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: var(--primary);
    display: block;
}

/* ===== FOOTER ===== */
.auth-footer {
    padding: 1.5rem 2.5rem;
    text-align: center;
    border-top: 1px solid var(--gray-100);
    background-color: var(--gray-50);
}

.auth-footer-text {
    color: var(--gray-600);
    font-size: 0.875rem;
}

.auth-footer-link {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.auth-footer-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ===== PASSWORD STRENGTH ===== */
.password-strength {
    margin-top: 0.5rem;
}

.strength-meter {
    height: 4px;
    background-color: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.375rem;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: var(--transition);
    border-radius: 2px;
}

.strength-text {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* ===== PASSWORD REQUIREMENTS ===== */
.password-requirements {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background-color: var(--gray-50);
    border-radius: var(--radius);
    font-size: 0.75rem;
}

.requirement {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
    color: var(--gray-500);
}

.requirement:last-child {
    margin-bottom: 0;
}

.requirement.valid {
    color: var(--success);
}

.requirement.valid::before {
    content: "✓";
    color: var(--success);
}

.requirement.invalid::before {
    content: "✗";
    color: var(--gray-300);
}

/* ===== TERMS & CONDITIONS ===== */
.terms-group {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.terms-text {
    font-size: 0.875rem;
    color: var(--gray-600);
    line-height: 1.25rem;
}

.terms-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.terms-link:hover {
    text-decoration: underline;
}

/* ===== SOCIAL LOGIN ===== */
.social-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--gray-400);
    font-size: 0.875rem;
}

.social-divider::before,
.social-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--gray-200);
}

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

.social-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background-color: white;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    color: var(--gray-700);
}

.social-btn:hover {
    border-color: var(--gray-400);
    background-color: var(--gray-50);
}

.social-btn:active {
    transform: scale(0.98);
}

.social-icon {
    width: 1.25rem;
    height: 1.25rem;
}

/* ===== RESET SPECIFIC ===== */
.reset-instructions {
    background-color: var(--gray-50);
    padding: 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .auth-container {
        padding: 1rem;
    }
    
    .auth-header,
    .auth-form,
    .auth-footer {
        padding: 1.5rem;
    }
    
    .auth-title {
        font-size: 1.5rem;
    }
    
    .auth-logo {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .remember-forgot {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .social-buttons {
        grid-template-columns: 1fr;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card {
    animation: fadeIn 0.4s ease-out;
}

/* ===== UTILITY ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }