/* ============================================
   Login Module Styles
   ============================================ */

/* Container */
.login-module {
    max-width: 400px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Form */
.login-module-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Field wrapper */
.login-module-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Label */
.login-module-label {
    font-size: 0.875em;
    font-weight: 500;
    color: var(--text-color, #2c3e50);
}

/* Input fields */
.login-module-input {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 2px solid var(--border-color, #dee2e6);
    border-radius: 8px;
    background: var(--card-bg, #ffffff);
    color: var(--text-color, #2c3e50);
    font-size: 0.9375em;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.login-module-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.login-module-input::placeholder {
    color: var(--text-muted, #6c757d);
    opacity: 1;
}

/* Submit button */
.login-module-submit-btn {
    width: 100% !important;
}

.login-module-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Links row */
.login-module-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

/* Link text */
.login-module-link {
    font-size: 0.8125em;
    color: #6366f1;
    text-decoration: none;
    transition: color 0.2s ease;
}

.login-module-link:hover {
    color: #4f46e5;
    text-decoration: underline;
}

/* Error message */
.login-module-error {
    font-size: 0.8125em;
    color: #dc3545;
    min-height: 0;
    transition: min-height 0.2s ease;
}

.login-module-error:not(:empty) {
    min-height: 1.2em;
}

/* Success message */
.login-module-success {
    font-size: 0.8125em;
    color: #198754;
    min-height: 0;
    transition: min-height 0.2s ease;
}

.login-module-success:not(:empty) {
    min-height: 1.2em;
}

/* Captcha area */
.login-module-captcha {
    margin: 0;
}

/* ============================================
   Logged-in State
   ============================================ */

.login-module-greeting {
    font-size: 1em;
    font-weight: 500;
    color: var(--text-color, #2c3e50);
    text-align: center;
    margin-bottom: 16px;
}

.login-module-user-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

/* ============================================
   Dark Theme
   ============================================ */

[data-bs-theme="dark"] .login-module-label {
    color: var(--text-color, #e2e8f0);
}

[data-bs-theme="dark"] .login-module-input {
    background: var(--card-bg, #1e293b);
    border-color: var(--border-color, #334155);
    color: var(--text-color, #e2e8f0);
}

[data-bs-theme="dark"] .login-module-input::placeholder {
    color: var(--text-muted, #64748b);
}

[data-bs-theme="dark"] .login-module-greeting {
    color: var(--text-color, #e2e8f0);
}

/* ============================================
   RTL Support
   ============================================ */

html[dir="rtl"] .login-module-links {
    flex-direction: row-reverse;
}

html[dir="rtl"] .login-module-user-actions {
    flex-direction: row-reverse;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 576px) {
    .login-module {
        max-width: 100%;
        padding: 12px;
    }

    .login-module-input {
        height: 40px;
        font-size: 0.875em;
        padding: 0 12px;
    }

    .login-module-submit-btn {
        height: 40px;
        font-size: 0.875em;
    }

    .login-module-links {
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }

    .login-module-user-actions {
        flex-direction: column;
        gap: 8px;
    }
}

/* ============================================
   Email Verification Styles
   ============================================ */

.email-verify-links {
    justify-content: center;
}

.email-verify-message {
    text-align: center;
    font-size: 0.9375em;
    line-height: 1.6;
    padding: 16px 0;
}

.email-verify-success {
    color: #198754;
}

.email-verify-error {
    color: #dc3545;
}

.email-verify-resend {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color, #dee2e6);
}

.email-verify-resend-text {
    font-size: 0.8125em;
    color: var(--text-muted, #6c757d);
    margin-bottom: 14px;
    text-align: center;
}

[data-bs-theme="dark"] .email-verify-success {
    color: #4ade80;
}

[data-bs-theme="dark"] .email-verify-error {
    color: #f87171;
}

[data-bs-theme="dark"] .email-verify-resend {
    border-top-color: var(--border-color, #334155);
}

[data-bs-theme="dark"] .email-verify-resend-text {
    color: var(--text-muted, #64748b);
}

/* ============================================
   Login Page (Full-page)
   ============================================ */

.login-page {
    padding: 0;
}

.login-page-section {
    max-width: 480px;
}

.login-page-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-page-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-page-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color, #2c3e50);
}

.login-page-input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 2px solid var(--border-color, #dee2e6);
    border-radius: 8px;
    background: var(--card-bg, #ffffff);
    color: var(--text-color, #2c3e50);
    font-size: 0.9375rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.login-page-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.login-page-input::placeholder {
    color: var(--text-muted, #6c757d);
    opacity: 1;
}

.login-page-submit-btn {
    width: 100% !important;
    height: 44px;
    margin-top: 4px;
}

.login-page-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.login-page-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.login-page-link {
    font-size: 0.875rem;
    color: #6366f1;
    text-decoration: none;
    transition: color 0.2s ease;
}

.login-page-link:hover {
    color: #4f46e5;
    text-decoration: underline;
}

.login-page-error {
    font-size: 0.8125em;
    color: #dc3545;
    min-height: 0;
    transition: min-height 0.2s ease;
}

.login-page-error:not(:empty) {
    min-height: 1.2em;
}

.login-page-success {
    font-size: 0.8125em;
    color: #198754;
    min-height: 0;
    transition: min-height 0.2s ease;
}

.login-page-success:not(:empty) {
    min-height: 1.2em;
}

.login-page-captcha {
    margin: 0;
}

.login-page-greeting {
    font-size: 1em;
    font-weight: 500;
    color: var(--text-color, #2c3e50);
    text-align: center;
    margin-bottom: 16px;
}

.login-page-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

/* Login Page - Dark Theme */
[data-bs-theme="dark"] .login-page-label {
    color: var(--text-color, #e2e8f0);
}

[data-bs-theme="dark"] .login-page-input {
    background: var(--card-bg, #1e293b);
    border-color: var(--border-color, #334155);
    color: var(--text-color, #e2e8f0);
}

[data-bs-theme="dark"] .login-page-input::placeholder {
    color: var(--text-muted, #64748b);
}

[data-bs-theme="dark"] .login-page-greeting {
    color: var(--text-color, #e2e8f0);
}

/* Login Page - RTL Support */
html[dir="rtl"] .login-page-links {
    flex-direction: row-reverse;
}

html[dir="rtl"] .login-page-actions {
    flex-direction: row-reverse;
}

/* Login Page - Responsive */
@media (max-width: 576px) {
    .login-page-section {
        max-width: 100%;
    }

    .login-page-input {
        height: 42px;
        font-size: 0.875rem;
        padding: 0 12px;
    }

    .login-page-submit-btn {
        height: 42px;
        font-size: 0.875rem;
    }

    .login-page-links {
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }

    .login-page-actions {
        flex-direction: column;
        gap: 8px;
    }
}
