/* auth_forms.css - Dark theme styles for authentication pages */

:root {
    --auth-primary-color: #1abc9c;
    --auth-primary-hover: orange;
    --auth-background-color: #0d0d0d;
    --auth-container-bg: #243342;
    --auth-text-color: #d0d8e6;
    --auth-text-light: #bdc3c7;
    --auth-border-color: #34495e;
    --auth-border-hover: #007bff;
    --auth-error-bg: #2d1b1b;
    --auth-error-text: #e74c3c;
    --auth-input-bg: #34495e;
    --auth-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Force dark background */
body {
    background-color: var(--auth-background-color) !important;
    margin: 0;
    padding: 0;
}

.auth-form-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    padding-top: 15px;
    background-color: var(--auth-background-color);
}

/* =========================
   Navigation bar
   ========================= */

.auth-nav {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 20px;
    padding: 10px 0;
}

.auth-nav-left {
    flex: 0 0 auto;
}

.auth-nav-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.auth-nav img {
    width: 40px;
    height: 40px;
}

.auth-nav-title {
    font-size: 18px;
    font-weight: bold;
}

/* =========================
   Card
   ========================= */

.auth-form-card {
    width: 100%;
    max-width: 400px;
    background-color: var(--auth-container-bg);
    padding: 30px;
    border: 1px solid transparent;
    border-radius: 10px;
    box-shadow: var(--auth-shadow);
    color: var(--auth-text-color);
    transition: border-color 0.3s ease;
}

.auth-form-card {
    position: relative;
    z-index: 10;
}

.auth-form-container::before,
.auth-form-container::after {
    pointer-events: none;
}

.auth-form-card:hover,
.auth-form-card:focus {
    border-color: var(--auth-border-hover);
    outline: none;
}

.auth-form-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: burlywood;
}

.auth-form-subtitle {
    text-align: center;
    color: var(--auth-text-light);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

/* =========================
   Form fields
   ========================= */

.auth-form-group {
    margin-bottom: 1.2rem;
}

.auth-form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Small help text for form validation messages */
.auth-form-help {
    font-size: 0.75rem;
    /* small text */
    color: var(--auth-text-light);
    margin-top: 0.25rem;
    line-height: 1.2;
}

/* Subtitle for instruction paragraphs */
.auth-form-subtitle {
    font-size: 0.9rem;
    /* normal instruction size */
    color: var(--auth-text-light);
    margin-bottom: 1.5rem;
    line-height: 1.4;
    text-align: center;
}

.auth-form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--auth-border-color);
    border-radius: 4px;
    font-size: 14px;
    background-color: var(--auth-input-bg);
    transition: border-color 0.3s ease;
}

.auth-form-input::placeholder {
    color: var(--auth-text-light);
}

.auth-form-input:focus {
    outline: none;
    border-color: var(--auth-border-hover);
}

/* =========================
   Primary button
   ========================= */

.auth-form-button {
    width: 100%;
    background-color: #3498db;
    color: #ffffff;
    /* ✅ explicit for contrast */
    border: none;
    border-radius: 5px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    display: block;
    transition: background-color 0.3s ease;
    text-decoration: none;
}

.auth-form-button:hover,
.auth-form-button:focus {
    background-color: #2980b9;
    text-decoration: underline;
    color: orange;
}

/* =========================
   Messages
   ========================= */

.auth-message {
    background-color: transparent;
    border: 1px solid;
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.auth-message--success {
    border-color: #d0d8e6;
}

.auth-message-icon {
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.auth-message--success .auth-message-icon {
    color: #2ecc71;
}

.auth-message-text {
    font-size: 0.9rem;
    font-weight: 500;
}

/* =========================
   Errors
   ========================= */

.auth-error-message {
    background-color: var(--auth-error-bg);
    border: 1px solid var(--auth-error-text);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.75rem;
}

.auth-error-icon {
    color: var(--auth-error-text);
    flex-shrink: 0;
}

.auth-error-text {
    font-size: 0.875rem;
    font-weight: 500;
}

.auth-field-error {
    font-size: 0.8rem;
    margin-top: 0.4rem;
}

.auth-field-error p {
    color: #ef4444;
    /* red-500 (Tailwind-like, readable on dark bg) */
    font-size: 0.875rem;
    line-height: 1.3;
}

/* =========================
   Utility buttons
   ========================= */

.auth-close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.auth-close-button:hover {
    background-color: rgba(255, 165, 0, 0.1);
}

.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 2rem;
}

.auth-button--secondary {
    background-color: transparent;
    border: 1px solid;
    border-radius: 5px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.auth-button--secondary:hover {
    background-color: currentColor;
    color: var(--auth-background-color);
}

/* Smaller links below primary buttons */
.auth-actions .auth-form-link {
    font-size: 0.85rem;
    /* Slightly smaller than normal text */
    margin-top: 1rem;
    /* Space between button and link */
    display: inline-block;
    /* Ensure margin-top applies */
}

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

@media (max-width: 768px) {
    .auth-form-container {
        padding: 15px;
        padding-top: 30px;
    }

    .auth-form-card {
        padding: 20px;
    }
}

#pwaInstallBtn {
    display: none;
}

/* =========================
   Email input fields styling
   ========================= */
.auth-form-input[type="email"] {
    width: 100%;
    /* Fill the available width */
    max-width: 360px;
    /* Slightly shorter than form card for padding */
    height: 44px;
    /* Slightly taller */
    font-size: 15px;
    /* Slightly larger font */
    background-color: #3b4a5a;
    /* Softer, dark gray-blue background */
    color: var(--auth-text-color);
    /* Keep text color readable */
    padding: 10px 14px;
    /* Comfortable padding */
    border: 1px solid var(--auth-border-color);
    border-radius: 5px;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.auth-form-input[type="email"]::placeholder {
    color: var(--auth-text-light);
}

.auth-form-input[type="email"]:focus {
    outline: none;
    border-color: var(--auth-primary-color);
    background-color: #4b5a6a;
    /* Slightly lighter on focus */
}

input[type="password"] {
    pointer-events: auto !important;
    user-select: text !important;
    cursor: text;
}

.auth-form-input[type="password"] {
    color: #ffffff;
    /* Bright bullets */
    letter-spacing: 0.12em;
    /* Makes dots more visible */
    font-weight: 600;
    /* Thicker bullets */
}

.auth-form-input[type="password"]:focus {
    background-color: #4b5a6a;
    border-color: var(--auth-primary-color);
}

.auth-form-input[type="email"],
.auth-form-input[type="password"] {
    width: 100%;
    max-width: 360px;
    height: 44px;
    font-size: 15px;
    padding: 10px 14px;
    border-radius: 5px;
}

/* Password visibility toggle button */
.password-input-wrapper {
    position: relative;
    width: 100%;
    max-width: 360px;
    /* match your input width */
}

.password-input-wrapper .auth-form-input {
    width: 100%;
    padding-right: 42px;
    /* room for eye icon */
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: var(--auth-text-light);
}

.password-toggle:hover {
    color: var(--auth-text-color);
}

/* Improve visibility of input text & toggle button */
/* Password input text visibility */
.auth-form-input[type="password"],
.auth-form-input[type="text"] {
    color: #ffffff;
}

/* Password toggle visibility */
.password-toggle {
    color: #ffffff;
    opacity: 0.8;
}

.password-toggle:hover {
    opacity: 1;
}

/* Force password toggle visibility */
.auth-form-card .password-input-wrapper .password-toggle {
    color: #ffffff !important;
    opacity: 1;
    z-index: 2;
}

/* Make the icon slightly larger */
.auth-form-card .password-input-wrapper .password-toggle {
    font-size: 18px;
}

/* Hovor feedback for password toggle */
.auth-form-card .password-input-wrapper .password-toggle:hover {
    opacity: 0.85;
}

/* =========================
   Fix input height jump issue
   ========================= */
/* Lock input height regardless of type toggle */
.auth-form-input {
    height: 44px;
    line-height: 24px;
    /* FIXES jump */
    padding: 10px 14px;
    box-sizing: border-box;
    /* CRITICAL */
}

/* Ensure consistency for password/text toggle */
.auth-form-input[type="password"],
.auth-form-input[type="text"] {
    height: 44px;
    line-height: 24px;
}

.auth-form-input {
    font-family: inherit;
    font-size: 15px;
}

/* Info text below input (like helper text) */
.auth-info-text {
    color: #d1d5db;
    /* light gray for subtle visibility */
    font-size: 0.875rem;
    /* slightly smaller than input text */
    margin-top: 0.5rem;
    /* spacing from the input */
    line-height: 1.3;
    /* readable spacing */
}

/* Make rules readable but subtle */
.auth-field-help {
    margin-top: 0.5rem;
    font-size: 13px;
    line-height: 1.4;
    color: var(--auth-text-light);
}

.auth-field-help ul {
    margin: 0.25rem 0 0 1rem;
    padding: 0;
}

.auth-field-help li {
    margin-bottom: 0.25rem;
}

/* =========================
   Password reset text
   ========================= */
.reset-text {
    font-size: 1rem;
    margin-bottom: 10px;
}

/* =========================
   Normalize login inputs
   ========================= */

/* make wrapper behave like normal field */
.password-input-wrapper {
    position: relative;
    width: 100%;
}

/* force identical input styling */
.form-control.auth-form-input {
    width: 100%;
    box-sizing: border-box;

    /* match email input typography */
    font-size: 1rem;
    font-weight: normal;

    /* make both inputs slightly less tall */
    padding-top: 8px;
    padding-bottom: 8px;

    /* space for toggle button */
    padding-right: 40px;
}

/* ensure placeholders match */
.form-control.auth-form-input::placeholder {
    font-size: 1rem;
    font-weight: normal;
}

/* Password reset email input styling */
#id_email,
#id_new_password1,
#id_new_password2 {
    width: 60%;
    /* a little wider if previously constrained */
    max-width: 400px;
    /* optional: limit very wide screens */
    height: 34px;
    /* slightly taller */
    padding: 6px 12px;
    /* adjust internal spacing */
    /*background-color: #f5f5f5;*/
    background-color: var(--auth-input-bg) !important;
    /* match other email inputs */
    color: #d0d8e6 !important;
    /* match text color in auth_forms.css */
    border: 1px solid transparent;
    /* optional: match other inputs */
    border-radius: 4px;
    /* match styling for consistency */
    font-size: 15px;
    /* adjust to match other inputs */
    box-sizing: border-box;
    /* ensures width includes padding */
}

/* =======================
   Auth Pages Navbar Adjustments
   ======================= */
@media (max-width: 768px) {

    .auth-page .brand-title {
        display: none;
    }

    .auth-page .nav-inner {
        flex-wrap: nowrap;
    }

    .auth-page .nav-text {
        margin-left: auto;
    }

    html,
    body {
        overflow-y: auto;
        height: auto;
    }

}