/* =========================================================
   CIU Student Panel - Auth theme (login + sign-up)
   Path: resource/css/auth.css
   Load AFTER bootstrap / head.php so it wins over AdminLTE.
   Everything is scoped by body.auth-page, so no other page
   is affected. Bootstrap 3.3 compatible, no build step.
   ========================================================= */

:root{
    --bg:         #0B1130;
    --navy:       #16204A;
    --gold:       #B98A3E;
    --gold-soft:  #E9C77E;
    --text:       #E8EAF4;
    --muted:      #9AA0BC;
    --line:       rgba(233,199,126,.20);
    --field:      rgba(11,17,48,.42);
    --field-line: rgba(255,255,255,.16);
    --field-h:    46px;
    --font:       'Sora', -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* AdminLTE sets html,body{height:100%} - that traps tall content.
   Let the page grow with its content so it scrolls normally. */
html{ height: auto; min-height: 100%; }

/* ---------- Page ---------- */
body.auth-page{
    height: auto;
    margin: 0;
    overflow-x: hidden;
    overflow-y: visible;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background:
        radial-gradient(340px 340px at 38% 38%, rgba(185,138,62,.34), transparent 70%),
        radial-gradient(420px 420px at 64% 64%, rgba(72,92,210,.30), transparent 70%),
        radial-gradient(900px 480px at 50% -8%, rgba(185,138,62,.18), transparent 62%),
        var(--bg);
    background-attachment: fixed;
}

/* faint grid, fading out from the centre */
body.auth-page:before{
    content: "";
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(233,199,126,.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(233,199,126,.06) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 42%, #000 15%, transparent 70%);
    mask-image: radial-gradient(ellipse at 50% 42%, #000 15%, transparent 70%);
}

.auth-page a{ color: var(--gold-soft); }
.auth-page a:hover,
.auth-page a:focus{ color: #fff; text-decoration: none; }

.auth-page a:focus,
.auth-page button:focus,
.auth-page .form-control:focus{ outline: none; }

.auth-page a:focus-visible,
.auth-page button:focus-visible{
    outline: 2px solid var(--gold-soft);
    outline-offset: 3px;
}

/* ---------- Layout ---------- */
/* shell = full-height page: card area (1fr) + footer (auto). Grid fills the screen reliably. */
.auth-shell{
    position: relative;
    display: grid;
    grid-template-rows: 1fr auto;
    min-height: 100vh;
    min-height: 100dvh;
}

.auth-main{
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.auth-card{
    position: relative;
    width: 100%;
    max-width: 400px;
    padding: 36px 32px 28px;
    background: rgba(22,32,74,.42);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.12),
        0 24px 60px -30px rgba(0,0,0,.65);
    animation: authIn .5s cubic-bezier(.2,.7,.3,1) both;
}

/* ---------- Sign-up: compact so the whole form fits one screen ---------- */
.auth-card-wide{
    --field-h: 44px;
    max-width: 560px;
    padding: 28px 32px 22px;
}
.auth-card-wide .form-group{ margin-bottom: 16px; }
.auth-card-wide .auth-note{ margin: 0 0 16px; }
.auth-card-wide .auth-links{ margin-top: 18px; padding-top: 14px; }

.auth-head.auth-head-inline{
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
    text-align: left;
}
.auth-head-inline img{ flex: 0 0 48px; width: 48px; height: 48px; padding: 6px; margin: 0; }
.auth-head-inline h1{ font-size: 20px; }
.auth-page .auth-head h1{ margin: 0; line-height: 1.25; }
.auth-page .auth-head p{ display: block; margin: 4px 0 0; line-height: 1.4; }

/* two fields side by side (password + confirm) */
.auth-row{ display: flex; gap: 14px; }
.auth-row .form-group{ flex: 1 1 0; min-width: 0; }

/* no blur support (old Android browsers): use a solid panel so text stays readable */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))){
    .auth-card{ background: rgba(18,27,64,.94); }
}

/* HUD corner brackets: the one memorable detail */
.auth-card:before,
.auth-card:after{
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 0 solid var(--gold-soft);
}
.auth-card:before{ top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; border-top-left-radius: 6px; }
.auth-card:after{ right: -1px; bottom: -1px; border-right-width: 2px; border-bottom-width: 2px; border-bottom-right-radius: 6px; }

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

.auth-head{ text-align: center; margin-bottom: 26px; }
.auth-head img{
    width: 64px; height: 64px;
    margin-bottom: 14px;
    padding: 8px;
    object-fit: contain;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--line), 0 0 0 6px rgba(233,199,126,.10);
}
.auth-head h1{
    margin: 0;
    font-family: var(--font);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: .2px;
    color: #fff;
}
.auth-head p{ margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }

/* ---------- Message ----------
   Two cases:
   1) plain text message  -> #message itself is the box
   2) Bootstrap/AdminLTE .alert inside #message -> the .alert is the box and #message is invisible,
      so when the x button removes the alert, nothing is left behind (no empty bar). */
.auth-page #message{
    margin-bottom: 18px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
    background: rgba(233,199,126,.10);
    border-left: 3px solid var(--gold-soft);
    border-radius: 3px;
    transition: opacity .2s;
}
.auth-page #message *{ color: inherit; margin: 0; }
.auth-page #message.is-error{ background: rgba(229,115,107,.12); border-left-color: #E5736B; }
.auth-page #message.is-success{ background: rgba(158,216,166,.10); border-left-color: #9ED8A6; }
.auth-page #message.is-hiding{ opacity: 0; }

/* case 2: wrapper becomes invisible, the alert carries the look */
.auth-page #message:has(.alert){
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
}
.auth-page #message .alert{
    margin: 0 0 18px !important;     /* AdminLTE paints .alert-* with !important, so we need it too */
    padding: 10px 12px !important;
    color: var(--text) !important;
    background: rgba(233,199,126,.10) !important;
    border: 0 !important;
    border-left: 3px solid var(--gold-soft) !important;
    border-radius: 3px !important;
    box-shadow: none !important;
    overflow: hidden;
}
.auth-page #message .alert-danger{ background: rgba(229,115,107,.12) !important; border-left-color: #E5736B !important; }
.auth-page #message .alert-success{ background: rgba(158,216,166,.10) !important; border-left-color: #9ED8A6 !important; }
.auth-page #message .alert h4{ margin: 0 0 4px; font-size: 14px; }

.auth-page #message .close{
    position: static;          /* Bootstrap shifts it right:-21px */
    float: right;
    margin-left: 12px;
    font-size: 18px;
    line-height: 1;
    color: var(--text) !important;
    text-shadow: none;
    opacity: .6;
    cursor: pointer;
}
.auth-page #message .close:hover{ opacity: 1; }

/* ---------- Form ---------- */
.auth-card .form-group{ margin: 0 0 18px; }

.auth-card label{
    display: block;
    margin-bottom: 7px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--muted);
}

.auth-card .form-control{
    height: var(--field-h);
    padding: 0 14px;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background: var(--field);
    border: 1px solid var(--field-line);
    border-radius: 4px;
    box-shadow: none;
    transition: border-color .15s, box-shadow .15s;
}

.auth-card .form-control::-webkit-input-placeholder{ color: rgba(154,160,188,.6); font-size: 13px; }
.auth-card .form-control::-moz-placeholder{ color: rgba(154,160,188,.6); font-size: 13px; }

.auth-card .form-control:focus{
    border-color: var(--gold-soft);
    box-shadow: 0 0 0 3px rgba(233,199,126,.16);
}

/* stop browser autofill from turning the field white */
.auth-card .form-control:-webkit-autofill{
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 40px #101840 inset;
}

/* number field without the spinner arrows */
.auth-card input[type=number]{ -moz-appearance: textfield; }
.auth-card input[type=number]::-webkit-inner-spin-button,
.auth-card input[type=number]::-webkit-outer-spin-button{ -webkit-appearance: none; margin: 0; }

.field-hint{ margin: 6px 0 0; font-size: 12px; color: var(--muted); }

/* leading icon inside a field */
.field-wrap{ position: relative; }
.field-wrap .form-control{ padding-left: 40px; }
.field-icon{
    position: absolute;
    top: 0; left: 0;
    width: 40px;
    height: var(--field-h);
    line-height: var(--field-h);
    text-align: center;
    color: var(--muted);
    pointer-events: none;
    transition: color .15s;
}
.field-wrap:focus-within .field-icon{ color: var(--gold-soft); }
.auth-card .form-group:focus-within > label{ color: var(--gold-soft); }

/* password strength: a 2px line along the bottom of the field (no extra height) */
.pw-meter{
    position: absolute;
    left: 4px; right: 4px; bottom: 0;
    height: 2px;
    overflow: hidden;
    border-radius: 2px;
    pointer-events: none;
}
.pw-meter span{
    display: block;
    height: 100%;
    width: 0;
    transition: width .25s, background-color .25s;
}
.pw-meter[data-s="1"] span{ width: 25%;  background: #E5736B; }
.pw-meter[data-s="2"] span{ width: 50%;  background: #E9C77E; }
.pw-meter[data-s="3"] span{ width: 75%;  background: #9ED8A6; }
.pw-meter[data-s="4"] span{ width: 100%; background: #5CC27A; }

/* password show / hide */
.pw-wrap{ position: relative; }
.pw-wrap .form-control{ padding-right: 42px; }

.pw-toggle{
    position: absolute;
    top: 0; right: 0;
    width: var(--field-h); height: var(--field-h);
    padding: 0;
    color: var(--muted);
    background: transparent;
    border: 0;
    cursor: pointer;
}
.pw-toggle:hover{ color: var(--gold-soft); }

/* primary button */
.btn-auth{
    display: block;
    width: 100%;
    height: var(--field-h);
    margin-top: 6px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    color: var(--navy);
    background: var(--gold-soft);
    border: 0;
    border-radius: 4px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
    cursor: pointer;
    transition: background .15s, box-shadow .15s;
}
.btn-auth:hover{
    background: #F1D693;
    box-shadow: 0 6px 20px -8px rgba(233,199,126,.6);
}
.btn-auth:active{ background: var(--gold); }

.auth-note{
    margin: 4px 0 20px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--muted);
}

/* ---------- Links under the form ---------- */
.auth-links{
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--muted);
}
.auth-links p{ margin: 0 0 4px; }
.auth-links a{ font-weight: 600; }

.auth-links-row{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.link-btn{
    padding: 0;
    font: inherit;
    color: var(--muted);
    background: none;
    border: 0;
    cursor: pointer;
}
.link-btn:hover{ color: var(--gold-soft); }

/* ---------- Support email hint: [ums@ciu.edu.bd] ---------- */
.mail-hint{
    font-size: 11.5px;
    color: var(--muted);
    white-space: nowrap;            /* never break the address across lines */
    -webkit-user-select: all;       /* one tap / click selects the whole address */
    user-select: all;
}

/* ---------- Footer ---------- */
.auth-foot{
    position: relative;
    flex-shrink: 0;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    text-align: center;
    font-size: 12px;
    color: var(--muted);
}
.auth-foot span{ display: inline-block; }
.auth-foot strong{ font-weight: 600; color: var(--gold-soft); }

/* ---------- Responsive / motion ---------- */
@media (max-height: 720px){
    .auth-main{ padding: 14px 16px; }
    .auth-card{ padding-top: 22px; padding-bottom: 18px; }
    .auth-head{ margin-bottom: 18px; }
    .auth-head img{ width: 52px; height: 52px; margin-bottom: 10px; }
    .auth-card .form-group{ margin-bottom: 14px; }
    .auth-links{ margin-top: 16px; padding-top: 12px; }
    .auth-foot{ padding-top: 8px; }
}

@media (max-width: 575px){
    .auth-row{ display: block; }
}

@media (max-width: 480px){
    .auth-card{ padding: 28px 20px 22px; }
}

@media (prefers-reduced-motion: reduce){
    .auth-card{ animation: none; }
    .auth-card .form-control,
    .btn-auth,
    .field-icon,
    .auth-page #message,
    .pw-meter span{ transition: none; }
}