/* ==========================================================================
   Tubman University - sign-in pages
   --------------------------------------------------------------------------
   login, first-time sign-in, forgot password and register carry their own
   HTML shell rather than inc/header.php, so they never see tu-theme.css.
   They were also using a different blue (#6dabe4) from the rest of the
   application (#2962ff), which made the first screen a staff member sees the
   one screen that did not match.

   This file aligns the identity and the interaction details ONLY. It
   deliberately leaves the layout alone: login.css sets the page background
   and the 20px card, and both are part of that page's design rather than
   mistakes to correct.
   ========================================================================== */

:root {
    --tu-blue:        #2962ff;
    --tu-blue-dark:   #1e4bd8;
    --tu-danger:      #c0392b;
    --tu-text:        #1f2430;
    --tu-text-muted:  #6b7280;
}

/* ==========================================================================
   A self-contained sign-in layout
   --------------------------------------------------------------------------
   The old login page used login.css's two-column .signin-content, which put
   a very large logo beside a short form inside a card wider than either
   needed, leaving most of the card empty. These classes replace that layout
   for the pages that opt into them; the .signin-form / .register-form rules
   further down still serve the pages that have not been moved over.
   ========================================================================== */

.tu-auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: #f4f6fa;
}

.tu-auth-card {
    width: 100%;
    max-width: 400px;          /* a sign-in form has no reason to be wider */
    background: #fff;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .08);
    padding: 32px 28px;
}

.tu-auth-brand { text-align: center; margin-bottom: 22px; }
.tu-auth-brand img { width: 76px; height: auto; }

.tu-auth-org {
    margin: 10px 0 0;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--tu-text-muted);
}

.tu-auth-title {
    margin: 0 0 20px;
    font-size: 19px;
    font-weight: 600;
    color: var(--tu-text);
    text-align: center;
    letter-spacing: -.01em;
}

.tu-auth-lead {
    margin: -8px 0 20px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--tu-text-muted);
    text-align: center;
}

.tu-auth-alert {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 16px;
}
.tu-auth-alert-error { background: #fdecea; border: 1px solid #f3c4bf; color: #8a1c13; }
.tu-auth-alert-info  { background: #eaf0ff; border: 1px solid #c7d7ff; color: #16307a; }

.tu-auth-field { margin-bottom: 16px; }

.tu-auth-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--tu-text-muted);
}

.tu-auth-card .form-control {
    width: 100%;
    border: 1px solid #d5d9e0;
    border-radius: 8px;
    padding: 11px 13px;
    font-size: 15px;
    color: var(--tu-text);
    background: #fff;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.tu-auth-card .form-control:focus {
    border-color: var(--tu-blue);
    box-shadow: 0 0 0 3px rgba(41, 98, 255, .14);
    outline: none;
}
.tu-auth-card .form-control.is-invalid { border-color: var(--tu-danger); }

/* The reveal control is a real button so it can be reached by keyboard and
   announced; it used to be an <i> that only responded to a mouse. */
.tu-auth-reveal { position: relative; }
.tu-auth-reveal .form-control { padding-right: 44px; }
.tu-auth-reveal button {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #7b8394;
    cursor: pointer;
}
.tu-auth-reveal button:hover { color: var(--tu-text); background: #f1f3f7; }
.tu-auth-reveal button:focus-visible {
    outline: 2px solid var(--tu-blue);
    outline-offset: 1px;
}

.tu-auth-error {
    display: block;
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--tu-danger);
}

/* One action, unmistakably the action. */
.tu-auth-submit {
    width: 100%;
    min-height: 44px;
    margin-top: 4px;
    border: 0;
    border-radius: 8px;
    background: var(--tu-blue);
    color: #fff;
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: .01em;
    cursor: pointer;
    transition: background-color .12s ease;
}
.tu-auth-submit:hover { background: var(--tu-blue-dark); }
.tu-auth-submit:focus-visible { outline: 2px solid var(--tu-blue); outline-offset: 2px; }

.tu-auth-links {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #eef0f4;
    text-align: center;
}
.tu-auth-links a { font-size: 13px; color: var(--tu-blue); font-weight: 600; }
.tu-auth-links a:hover { color: var(--tu-blue-dark); text-decoration: underline; }

.tu-auth-note {
    margin: 10px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--tu-text-muted);
    text-align: center;
}

.tu-auth-foot {
    margin-top: 18px;
    text-align: center;
    font-size: 11.5px;
    color: #9aa1ae;
}

@media (max-width: 420px) {
    .tu-auth-card { padding: 26px 20px; border-radius: 10px; }
    .tu-auth-brand img { width: 64px; }
}

/* ---------- Fields ------------------------------------------------------- */

.signin-form .form-control,
.register-form .form-control {
    border: 1px solid #d5d9e0;
    color: var(--tu-text);
    transition: border-color .12s ease, box-shadow .12s ease;
}

/* A visible focus ring: these forms previously gave no indication at all of
   which field was active, which matters most on the page people meet first. */
.signin-form .form-control:focus,
.register-form .form-control:focus {
    border-color: var(--tu-blue);
    box-shadow: 0 0 0 3px rgba(41, 98, 255, .14);
    outline: none;
}

.register-form .form-control.is-invalid {
    border-color: var(--tu-danger);
}
.register-form .invalid-feedback {
    font-size: 12.5px;
    color: var(--tu-danger);
}

::placeholder { color: #9aa1ae; opacity: 1; }

/* ---------- The primary action ------------------------------------------ */
/* Colour only. The pill shape comes from login.css and is left as designed. */

.register-form .btn-primary,
.signin-form .btn-primary {
    background-color: var(--tu-blue);
    border-color: var(--tu-blue);
    font-weight: 600;
    letter-spacing: .01em;
    transition: background-color .12s ease;
}
.register-form .btn-primary:hover,
.register-form .btn-primary:focus,
.signin-form .btn-primary:hover,
.signin-form .btn-primary:focus {
    background-color: var(--tu-blue-dark);
    border-color: var(--tu-blue-dark);
}

/* Keyboard users need to see where they are. */
.register-form .btn:focus-visible,
.signin-form a:focus-visible {
    outline: 2px solid var(--tu-blue);
    outline-offset: 2px;
}

/* ---------- Secondary links ---------------------------------------------- */

.forgot-pass {
    color: var(--tu-blue);
    font-size: 13px;
}
.forgot-pass:hover {
    color: var(--tu-blue-dark);
    text-decoration: underline;
}

/* The sign-in card now carries two or three links; space them so they do not
   read as one run-on line. */
.signin-form .form-group + .form-group > .forgot-pass { display: inline-block; margin-top: 2px; }

/* ---------- Small screens ------------------------------------------------ */

@media (max-width: 767.98px) {
    /* The decorative logo panel eats the whole screen on a phone and pushes
       the actual form below the fold. */
    .signin-image { display: none; }

    .signin-content {
        display: block;
        padding: 20px 16px;
        margin: 16px;
    }

    .signin-form { width: 100%; max-width: 100%; }

    /* Full-width, properly tappable controls. */
    .register-form .btn,
    .signin-form .btn { width: 100%; min-height: 44px; }

    .register-form .form-control { min-height: 44px; font-size: 16px; }
}

/* 16px on inputs stops iOS Safari zooming the page in when a field is
   focused, which on a login form looks like the layout has broken. */
@media (max-width: 991.98px) {
    input[type="text"], input[type="password"], input[type="email"] { font-size: 16px; }
}
