/* ===================================================
   BitHQ Auth Pages – Modern Responsive Stylesheet
   =================================================== */

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    height: 100%;
}

body.auth-body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7f6;
    color: #2d3436;
    -webkit-font-smoothing: antialiased;
}

/* --- Split Layout --- */
.auth-wrapper {
    display: flex;
    min-height: 100vh;
}

/* --- Brand Panel (Left) --- */
.auth-brand {
    width: 42%;
    background: linear-gradient(160deg, #1c2c23 0%, #2a4435 50%, #3c5f4b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
    position: relative;
    overflow: hidden;
}

.auth-brand::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.04) 0%, transparent 70%);
    top: -120px;
    right: -100px;
}

.auth-brand::after {
    content: '';
    position: absolute;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 70%);
    bottom: -80px;
    left: -60px;
}

.auth-brand-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    width: 100%;
    max-width: 320px;
}

.auth-logo {
    width: 260px;
    max-width: 100%;
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

.auth-tagline {
    color: rgba(255,255,255,0.55);
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.3px;
    margin-top: 1.75rem;
    line-height: 1.6;
}

/* --- Form Panel (Right) --- */
.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
    background: #fff;
    position: relative;
}

.auth-form-container {
    width: 100%;
    max-width: 440px;
    animation: authFadeUp 0.45s ease-out;
}

.auth-form-container.auth-form-wide {
    max-width: 600px;
}

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

/* --- Typography --- */
.auth-heading {
    font-size: 1.625rem;
    font-weight: 700;
    color: #1c2c23;
    margin: 0 0 0.375rem 0;
    letter-spacing: -0.3px;
}

.auth-subheading {
    color: #7f8c8d;
    font-size: 0.9rem;
    font-weight: 400;
    margin: 0 0 2rem 0;
    line-height: 1.5;
}

/* --- Flash / Alert Messages --- */
.auth-alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.auth-alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.auth-alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.auth-alert-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

/* --- Form Elements --- */
.auth-field {
    margin-bottom: 1.25rem;
}

.auth-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}

.auth-input {
    display: block;
    width: 100%;
    height: 46px;
    padding: 0 0.875rem;
    font-family: inherit;
    font-size: 0.9375rem;
    color: #1c2c23;
    background: #fff;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.auth-input::placeholder {
    color: #9ca3af;
}

.auth-input:hover {
    border-color: #9ca3af;
}

.auth-input:focus {
    border-color: #3c5f4b;
    box-shadow: 0 0 0 3px rgba(60, 95, 75, 0.12);
}

.auth-input.is-invalid {
    border-color: #ef4444;
}

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

.auth-field-error {
    display: block;
    font-size: 0.8rem;
    color: #dc2626;
    margin-top: 0.3rem;
}

/* --- Checkbox --- */
.auth-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.auth-check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
    position: relative;
}

.auth-check input[type="checkbox"]:checked {
    background: #1c2c23;
    border-color: #1c2c23;
}

.auth-check input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.auth-check input[type="checkbox"]:focus {
    box-shadow: 0 0 0 3px rgba(60, 95, 75, 0.12);
}

.auth-check-label {
    font-size: 0.875rem;
    color: #4b5563;
    user-select: none;
}

/* --- Buttons --- */
.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 46px;
    padding: 0 1.5rem;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    background: #1c2c23;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    letter-spacing: 0.2px;
}

.auth-btn:hover {
    background: #2a4435;
}

.auth-btn:active {
    transform: scale(0.985);
}

.auth-btn:focus-visible {
    outline: 2px solid #3c5f4b;
    outline-offset: 2px;
}

/* --- Row Helper (for register form) --- */
.auth-row {
    display: flex;
    gap: 1rem;
}

.auth-row > .auth-field {
    flex: 1;
    min-width: 0;
}

/* --- Links --- */
.auth-link {
    color: #3c5f4b;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s ease;
}

.auth-link:hover {
    color: #1c2c23;
    text-decoration: underline;
}

/* --- Meta Row (remember me + forgot) --- */
.auth-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

/* --- Footer Links --- */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f0f0f0;
    font-size: 0.875rem;
    color: #6b7280;
}

/* --- Divider --- */
.auth-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 1.75rem 0;
}

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

/* Tablet */
@media (max-width: 991px) {
    .auth-wrapper {
        flex-direction: column;
    }

    .auth-brand {
        width: 100%;
        padding: 2.5rem 2rem;
        min-height: auto;
    }

    .auth-brand::before {
        width: 300px;
        height: 300px;
        top: -80px;
        right: -60px;
    }

    .auth-brand::after {
        width: 200px;
        height: 200px;
        bottom: -60px;
        left: -40px;
    }

    .auth-logo {
        width: 200px;
    }

    .auth-tagline {
        font-size: 0.85rem;
        margin-top: 1rem;
    }

    .auth-form-panel {
        padding: 2.5rem 2rem;
    }

    .auth-form-container,
    .auth-form-container.auth-form-wide {
        max-width: 480px;
    }
}

/* Mobile */
@media (max-width: 575px) {
    .auth-brand {
        padding: 2rem 1.25rem;
    }

    .auth-logo {
        width: 160px;
    }

    .auth-tagline {
        font-size: 0.8rem;
    }

    .auth-form-panel {
        padding: 1.75rem 1.25rem;
    }

    .auth-heading {
        font-size: 1.375rem;
    }

    .auth-subheading {
        font-size: 0.85rem;
        margin-bottom: 1.5rem;
    }

    .auth-input {
        height: 44px;
        font-size: 16px; /* prevents iOS zoom */
    }

    .auth-btn {
        height: 44px;
    }

    .auth-row {
        flex-direction: column;
        gap: 0;
    }

    .auth-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}
