/* ====================================================================
   AUTH / LOGIN PAGE STYLES
   File: public/css/pages/auth/login.css
   ==================================================================== */

/* ------------------------------------------------------------------
   Brand colour tokens (single source of truth)
   ------------------------------------------------------------------ */
:root {
    --auth-green:      #236203;
    --auth-green-dark: #1c4f02;
    --auth-green-deep: #163c02;
    --auth-green-ring: rgba(35, 98, 3, 0.15);
    --auth-green-glow: rgba(35, 98, 3, 0.32);
}

/* ------------------------------------------------------------------
   Base reset — height-only on html, full styling on body
   ------------------------------------------------------------------ */
html {
    height: 100%;
}

body.auth-layout {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background-color: #f4f6f9;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ------------------------------------------------------------------
   Container: full-height two-column flex row
   ------------------------------------------------------------------ */
.auth-container {
    display: flex;
    min-height: 100vh;
}

/* ------------------------------------------------------------------
   Left panel – city hall photo + dark overlay + branding
   ------------------------------------------------------------------ */
.auth-left {
    flex: 0 0 55%;
    max-width: 55%;
    background-image: url('../../../city_hall.jpg');
    background-size: cover;
    background-position: center center;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Dark gradient overlay so white text stays legible over the photo */
.auth-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.52) 0%,
        rgba(0, 0, 0, 0.38) 55%,
        rgba(0, 0, 0, 0.60) 100%
    );
    pointer-events: none;
    z-index: 0;
}

/* Branding content — flex:1 fills the space above the landmark strip */
.auth-left-inner {
    flex: 1;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
    text-align: center;
}

/* Landmark strip — 30px, repeat-x, pinned to left column bottom */
.auth-left-landmark {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 30px;
    flex-shrink: 0;
    background-image: url('../../../landmark.png');
    background-repeat: repeat-x;
    background-size: auto 30px;
    background-position: left top;
}

.auth-brand-title {
    color: #ffffff;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 0.625rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.auth-brand-subtitle {
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.9375rem;
    line-height: 1.65;
    margin: 0;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.40);
}

/* ------------------------------------------------------------------
   Right panel – login form
   ------------------------------------------------------------------ */
.auth-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.75rem;
    background: #ffffff;
    overflow-y: auto;
}

.auth-form-wrap {
    width: 100%;
    max-width: 400px;
}

/* ------------------------------------------------------------------
   Logo bar (presentational div, not a link)
   ------------------------------------------------------------------ */
.auth-logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1.875rem;
}

.auth-logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.auth-logo-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a2b1a;
    letter-spacing: 0.02em;
}

/* ------------------------------------------------------------------
   Page headings
   ------------------------------------------------------------------ */
.auth-heading {
    font-size: 1.625rem;
    font-weight: 700;
    color: #1a2b1a;
    margin-bottom: 0.25rem;
}

.auth-subheading {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 1.75rem;
}

/* ------------------------------------------------------------------
   Form elements
   ------------------------------------------------------------------ */
.auth-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.375rem;
}

.auth-input {
    height: 44px;
    border-radius: 8px;
    border: 1.5px solid #d1d5db;
    font-size: 0.9375rem;
    color: #111827;
    padding: 0 0.875rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background-color: #ffffff;
}

.auth-input:focus {
    border-color: var(--auth-green);
    box-shadow: 0 0 0 3px var(--auth-green-ring);
    outline: none;
    background-color: #ffffff;
}

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

.auth-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

/* Password input wrapper (relative container for the toggle button) */
.auth-input-wrapper {
    position: relative;
}

.auth-input-wrapper .auth-input {
    width: 100%;
    padding-right: 2.75rem;
}

.auth-password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 0;
    line-height: 1;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* ------------------------------------------------------------------
   iCheck override – green accent to match theme
   ------------------------------------------------------------------ */
.icheck-primary > input:first-child:checked + label::before,
.icheck-primary > input:first-child:checked + input[type='hidden'] + label::before {
    background-color: var(--auth-green);
    border-color: var(--auth-green);
}

/* ------------------------------------------------------------------
   Remember me + Forgot password row
   ------------------------------------------------------------------ */
.auth-form-extras {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.375rem;
}

.auth-form-extras .icheck-primary > label {
    font-size: 0.875rem;
    color: #374151;
    padding-left: 0.25rem;
}

/* ------------------------------------------------------------------
   Shared text-link style (forgot password + sign-up)
   ------------------------------------------------------------------ */
.auth-text-link {
    color: var(--auth-green);
    font-weight: 500;
    text-decoration: none;
}

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

.auth-forgot-link {
    font-size: 0.85rem;
    white-space: nowrap;
}

/* ------------------------------------------------------------------
   Shared green focus ring (password toggle + social button)
   ------------------------------------------------------------------ */
.auth-password-toggle:focus,
.auth-btn-social:focus {
    outline: 2px solid var(--auth-green);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ------------------------------------------------------------------
   Submit button
   ------------------------------------------------------------------ */
.auth-submit-btn {
    height: 46px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    margin-bottom: 1.5rem;
    background: var(--auth-green);
    border-color: var(--auth-green);
    color: #ffffff;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-submit-btn:hover,
.auth-submit-btn:focus {
    background: var(--auth-green-dark);
    border-color: var(--auth-green-dark);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--auth-green-glow);
}

.auth-submit-btn:active {
    background: var(--auth-green-deep);
    border-color: var(--auth-green-deep);
}

/* ------------------------------------------------------------------
   Divider "or continue with"
   ------------------------------------------------------------------ */
.auth-divider {
    display: flex;
    align-items: center;
    color: #9ca3af;
    font-size: 0.8125rem;
    margin-bottom: 1rem;
}

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

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

/* ------------------------------------------------------------------
   Social login buttons
   ------------------------------------------------------------------ */
.auth-social {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.625rem;
}

.auth-btn-social {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 44px;
    border-radius: 8px;
    border: 1.5px solid #d1d5db;
    background: #ffffff;
    color: #374151;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.auth-btn-social:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-decoration: none;
}

.auth-social-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}

/* ------------------------------------------------------------------
   Sign-up footer link
   ------------------------------------------------------------------ */
.auth-signup-text {
    text-align: center;
    font-size: 0.875rem;
    color: #6c757d;
    margin: 0;
}

.auth-signup-link {
    font-weight: 600;
}

/* ------------------------------------------------------------------
   Session/alert messages
   ------------------------------------------------------------------ */
.auth-alert {
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

/* ------------------------------------------------------------------
   Responsive: mobile — single column, soft green tint
   ------------------------------------------------------------------ */
@media (max-width: 767.98px) {
    .auth-left {
        display: none;
    }

    .auth-right {
        padding: 2rem 1.25rem;
        min-height: 100vh;
        background: linear-gradient(170deg, #edf5e8 0%, #ffffff 35%);
    }

    .auth-form-wrap {
        max-width: 100%;
    }

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

/* ------------------------------------------------------------------
   Wide screens
   ------------------------------------------------------------------ */
@media (min-width: 1400px) {
    .auth-left {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* ------------------------------------------------------------------
   Reduced motion — suppress transitions for users who opt out
   ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    .auth-input,
    .auth-submit-btn,
    .auth-btn-social {
        transition: none;
    }
}
