/* ============================================================
   ASG Portal — Modern UI design system
   Clean-minimal SaaS restyle. Visual layer only.
   Loaded by: auth views + report pages.
   (Dashboard Index_v2.php and admin/style.css carry their own
    copy of these tokens so each surface is self-contained —
    keep token values in sync if you change them here.)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Brand greens — kept close to the existing portal hues, systematized */
    --asg-brand:        #4a8a2e;   /* primary accent  */
    --asg-brand-strong: #3b6d11;   /* deep / active text */
    --asg-brand-soft:   #7eab55;
    --asg-brand-600:    #41801f;
    --asg-brand-700:    #2f6b16;
    --asg-brand-50:     #f3f9ec;
    --asg-brand-100:    #e9f4dd;   /* tint background */

    /* Cool neutral scale */
    --asg-bg:            #f6f7f9;
    --asg-surface:       #ffffff;
    --asg-surface-2:     #fafbfc;
    --asg-border:        #e7eaee;
    --asg-border-strong: #d7dbe0;
    --asg-ink:           #1b2230;  /* headings */
    --asg-ink-2:         #454d5a;  /* body text */
    --asg-muted:         #8a929e;  /* labels / secondary */
    --asg-faint:         #aab0ba;

    /* Semantic */
    --asg-pos:    #2f7d32;  --asg-pos-bg:  #e9f6ec;
    --asg-neg:    #c62828;  --asg-neg-bg:  #fdecec;
    --asg-warn:   #8a5a0b;  --asg-warn-bg: #fbeeda;

    /* Radii */
    --asg-r-sm: 8px;  --asg-r: 10px;  --asg-r-lg: 14px;  --asg-r-xl: 18px;  --asg-r-pill: 999px;

    /* Shadows */
    --asg-shadow-xs: 0 1px 2px rgba(16,24,40,.05);
    --asg-shadow-sm: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.04);
    --asg-shadow:    0 4px 12px rgba(16,24,40,.08);
    --asg-shadow-lg: 0 12px 32px rgba(16,24,40,.14);

    /* Type */
    --asg-font: 'Inter', 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    /* Legacy-compat aliases referenced by dashboard inline CSS */
    --color-background-primary:   var(--asg-surface);
    --color-background-secondary: var(--asg-bg);
    --color-border-tertiary:      var(--asg-border);
}

/* ============================================================
   AUTH PAGES  (Login / OTP / Register / Reset, all steps)
   Overrides the legacy elevator-photo + green-gradient card.
   Selectors mirror legacy specificity so source order wins.
   No markup / JS / form-field changes.
   ============================================================ */

/* Neutralise the legacy washed-out overlay + empty switcher */
#portal-login ~ .overlay,
.overlay { background: transparent !important; pointer-events: none; }
.nav-bar-switcher { display: none; }

#portal-login {
    padding: 96px 16px 48px;
    min-height: 100vh;
    background: linear-gradient(155deg, #f4f9ec 0%, #eef3f7 55%, #f6f7f9 100%);
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--asg-font);
}

/* The card — override Bootstrap grid floats + legacy gradient */
#portal-login .form {
    float: none;
    width: 100%;
    max-width: 408px;
    margin: 0 auto;
    padding: 36px 34px 34px;
    color: var(--asg-ink-2);
    background: var(--asg-surface);
    border: 1px solid var(--asg-border);
    border-radius: var(--asg-r-xl);
    box-shadow: var(--asg-shadow-lg);
    overflow: visible;
}

#portal-login .form .title {
    text-align: center;
    margin: 4px 0 26px;
}
#portal-login .form .title small {
    display: block;
    color: var(--asg-ink);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* Inputs */
#portal-login .form .wrap-input100 {
    width: 100%;
    position: relative;
    border-bottom: 0;
    margin-bottom: 16px;
}
#portal-login .form .input100 {
    font-family: var(--asg-font);
    font-size: 14px;
    color: var(--asg-ink);
    line-height: 1.2;
    display: block;
    width: 100%;
    height: 46px;
    background: var(--asg-surface);
    border: 1px solid var(--asg-border-strong);
    border-radius: var(--asg-r);
    padding: 0 14px 0 42px;
    box-shadow: var(--asg-shadow-xs);
    transition: border-color .15s, box-shadow .15s;
}
#portal-login .form .input100::placeholder { color: var(--asg-faint); }
#portal-login .form .input100:focus,
#portal-login .form .input100:active {
    outline: none;
    border-color: var(--asg-brand);
    box-shadow: 0 0 0 3px rgba(74,138,46,.16);
}

/* Leading icon — the FA glyph is the <i>'s ::before.
   The legacy stylesheet floats this glyph out of the field on :focus/:valid
   and bumps .fa-lock/.fa-mobile to 24px via higher-specificity rules, so the
   few glyph-positioning props below are forced with !important to pin the
   icon in the input's left gutter in every state. */
#portal-login .form .focus-input100 {
    position: absolute;
    left: 0;
    top: 0 !important;
    width: 42px;
    height: 100%;
    color: var(--asg-faint);
    pointer-events: none;
}
#portal-login .form .focus-input100::before {
    position: absolute !important;
    top: 50% !important;
    left: 0 !important;
    width: 100% !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center;
    font-size: 15px !important;
    color: var(--asg-faint);
    transition: none !important;
}
#portal-login .form .focus-input100::after { display: none !important; }

/* Inline "send SMS" link (OTP page). Legacy "#portal-login .wrap-input100 a.button"
   is (1,2,1) and the autofill rule is !important, so we match with a higher-specificity
   selector and force the brand color. */
#portal-login .form .wrap-input100 a.button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--asg-brand-strong) !important;
    background: var(--asg-brand-100);
    border-radius: var(--asg-r-pill);
    cursor: pointer;
    pointer-events: auto;
    text-decoration: none;
}
#portal-login .form .wrap-input100 a.button:hover { background: var(--asg-brand-soft); color: #fff !important; }

/* Primary submit button (keeps its inline pill radius) */
#portal-login .form .btn-transparent {
    width: 100%;
    margin-top: 8px;
    padding: 12px 18px;
    font-family: var(--asg-font);
    font-size: 14px;
    font-weight: 600;
    color: #fff !important;
    background: var(--asg-brand);
    border: 1px solid var(--asg-brand);
    box-shadow: var(--asg-shadow-sm);
    transition: background .15s, box-shadow .15s;
}
#portal-login .form .btn-transparent:hover,
#portal-login .form .btn-transparent:focus {
    background: var(--asg-brand-600);
    border-color: var(--asg-brand-600);
    color: #fff !important;
    box-shadow: var(--asg-shadow);
}

/* Links inside the card (override legacy inline white) */
#portal-login .form a,
#portal-login .form small a {
    color: var(--asg-brand-strong) !important;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}
#portal-login .form a:hover { text-decoration: underline; }
/* "forgot password" link sits above the button */
#portal-login .form > form > a { display: inline-block; margin: 2px 0 14px; }

/* Alerts inside the card.
   Legacy ".alert" is hidden by default (display:none) and revealed by JS, and
   is absolutely positioned as a banner across the card top. We preserve the
   hidden-by-default behaviour (the always-present empty alert boxes must stay
   hidden on load) but lay a revealed alert out inline within the card. */
#portal-login .form .alert {
    display: none;
    position: static;
    width: auto;
    top: auto;
    left: auto;
    text-align: left;
    border-radius: var(--asg-r-sm);
    border: 1px solid transparent;
    font-size: 13px;
    padding: 9px 12px;
    margin-bottom: 14px;
}
#portal-login .form .alert-danger {
    color: var(--asg-neg);
    background: var(--asg-neg-bg);
    border-color: #f3cccc;
}
#portal-login .form .alert-success {
    color: var(--asg-pos);
    background: var(--asg-pos-bg);
    border-color: #cce8d2;
}

/* Responsive */
@media (max-width: 480px) {
    #portal-login { padding: 84px 12px 32px; }
    #portal-login .form { padding: 28px 22px 26px; }
}
