/* login, forgot password and reset password (layouts/auth-master.blade.php) */

:root {
    --auth-navy: #0b2a57;
    --auth-blue: #1d6fd1;
    --auth-sky: #2b90d9;
    --auth-cyan: #22c1ee;
    --auth-ink: #0f172a;
    --auth-text: #334155;
    --auth-muted: #64748b;
    --auth-line: #d9e2ee;
    --auth-field: #f8fafc;
    --auth-danger: #e5484d;
    --auth-success: #15803d;
}

body.auth-page {
    margin: 0;
    min-height: 100vh;
    font-family: "Inter", "Open Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--auth-text);
    background: #fff;
    -webkit-font-smoothing: antialiased;
}

.auth {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    min-height: 100vh;
}

/* ---------- the brand side ---------- */

.auth-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 56px;
    color: #fff;
    background:
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .09) 1px, transparent 0) 0 0 / 22px 22px,
        linear-gradient(150deg, #081f45 0%, var(--auth-navy) 35%, #134c95 70%, #1f6fc4 100%);
}

.auth-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .5;
    translate: calc(var(--mx, 0) * var(--depth)) calc(var(--my, 0) * var(--depth));
    transition: translate .4s ease-out;
    animation: authFloat 16s ease-in-out infinite alternate;
}
.auth-blob.b1 { --depth: 50px; width: 460px; height: 460px; top: -140px; left: -120px; background: var(--auth-sky); }
.auth-blob.b2 { --depth: -60px; width: 420px; height: 420px; bottom: -160px; right: -120px; background: var(--auth-cyan); opacity: .35; animation-duration: 20s; }

/* the middle: a big glowing loop (the logo's mark) and the welcome */
.auth-brand-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: auto;
    text-align: center;
}

.auth-hero {
    position: relative;
    width: min(380px, 80%);
    translate: calc(var(--mx, 0) * 18px) calc(var(--my, 0) * 18px);
    transition: translate .35s ease-out;
    animation: authRise .8s cubic-bezier(.2, .8, .2, 1) both;
}
.auth-hero::before {
    content: "";
    position: absolute;
    inset: -30% -10%;
    background: radial-gradient(closest-side, rgba(43, 144, 217, .45), transparent);
    animation: authBreathe 4.5s ease-in-out infinite;
}

.auth-loop { position: relative; display: block; width: 100%; overflow: visible; }
.auth-loop .track { fill: none; stroke: url(#authTrack); stroke-opacity: .35; stroke-width: 9; stroke-linecap: round; }
.auth-loop .comet {
    fill: none;
    stroke: url(#authComet);
    stroke-width: 9;
    stroke-linecap: round;
    stroke-dasharray: 22 78;
    filter: drop-shadow(0 0 8px rgba(125, 211, 252, .9));
    animation: authLoop 3.2s linear infinite;
}

.auth-brand h1 {
    margin: 46px 0 0;
    font-size: 42px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.02em;
    color: #fff;
    animation: authRise .8s .15s cubic-bezier(.2, .8, .2, 1) both;
}

.auth-brand-foot { position: relative; z-index: 1; margin: 0; font-size: 13px; text-align: center; color: rgba(255, 255, 255, .55); }

/* ---------- the form side ---------- */

.auth-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background:
        radial-gradient(600px 300px at 100% 0%, rgba(43, 144, 217, .07), transparent 70%),
        radial-gradient(500px 260px at 0% 100%, rgba(34, 193, 238, .06), transparent 70%),
        #fff;
}

.auth-card { width: 100%; max-width: 400px; animation: authRise .6s cubic-bezier(.2, .8, .2, 1) both; }
.auth-logo { display: block; height: 40px; margin-bottom: 34px; }
.auth-title { margin: 0 0 8px; font-size: 28px; font-weight: 700; letter-spacing: -.02em; color: var(--auth-ink); }
.auth-subtitle { margin: 0 0 28px; font-size: 15px; line-height: 1.5; color: var(--auth-muted); }
.auth-foot { display: none; margin: 36px 0 0; font-size: 13px; color: #94a3b8; }

/* a text field: icon, floating label, show password */
.auth-field { position: relative; margin-bottom: 16px; }
.auth-field .form-control {
    display: block;
    width: 100%;
    height: 54px;
    padding: 22px 46px 6px 46px;
    font-size: 15px;
    color: var(--auth-ink);
    background: var(--auth-field);
    border: 1.5px solid var(--auth-line);
    border-radius: 12px;
    box-shadow: none;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.auth-field .form-control:hover { border-color: #b8c7da; }
.auth-field .form-control:focus {
    outline: none;
    background: #fff;
    border-color: var(--auth-blue);
    box-shadow: 0 0 0 4px rgba(29, 111, 209, .14);
}
.auth-field .form-control:-webkit-autofill { -webkit-box-shadow: 0 0 0 1000px #fff inset; -webkit-text-fill-color: var(--auth-ink); }

.auth-label {
    position: absolute;
    top: 27px;
    left: 46px;
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--auth-muted);
    pointer-events: none;
    transform: translateY(-50%);
    transition: top .18s ease, font-size .18s ease, color .18s ease;
}
.auth-field .form-control:focus ~ .auth-label,
.auth-field .form-control:not(:placeholder-shown) ~ .auth-label,
.auth-field .form-control:-webkit-autofill ~ .auth-label { top: 16px; font-size: 11.5px; letter-spacing: .02em; }
.auth-field .form-control:focus ~ .auth-label { color: var(--auth-blue); }

.auth-field-icon,
.auth-field .password-eye {
    position: absolute;
    top: 27px;
    transform: translateY(-50%);
    font-size: 16px;
    color: #94a3b8;
    transition: color .2s ease, transform .2s ease;
}
.auth-field-icon { left: 17px; pointer-events: none; }
.auth-field .form-control:focus ~ .auth-field-icon { color: var(--auth-blue); }
.auth-field .password-eye { right: 16px; cursor: pointer; }
.auth-field .password-eye:hover { color: var(--auth-ink); transform: translateY(-50%) scale(1.12); }

/* errors: the server's and jQuery validate's */
.auth-field .form-control.error { border-color: var(--auth-danger); }
.auth-field label.error,
.auth-error {
    display: block;
    margin: 6px 2px 0;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--auth-danger);
    text-align: left;
}

.auth-card .invalid-feedback.login-atmp,
.auth-card .alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 18px;
    padding: 12px 14px;
    font-size: 14px;
    text-align: left;
    border-radius: 12px;
    animation: authShake .45s ease both;
}
.auth-card .invalid-feedback.login-atmp { color: #b42318; background: #fef3f2; border: 1px solid #fecdca; }
.auth-card .invalid-feedback.login-atmp::before { content: "\f071"; font-family: FontAwesome; }
.auth-card .alert-success { color: var(--auth-success); background: #f0fdf4; border: 1px solid #bbf7d0; animation: authRise .5s ease both; }
.auth-card .alert-success::before { content: "\f058"; font-family: FontAwesome; }

/* remember me and the links */
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 22px; }
.auth-check { display: inline-flex; align-items: center; gap: 9px; margin: 0; font-size: 14px; font-weight: 500; color: var(--auth-text); cursor: pointer; user-select: none; }
.auth-check input { width: 17px; height: 17px; margin: 0; accent-color: var(--auth-blue); cursor: pointer; }
.auth-link { font-size: 14px; font-weight: 600; color: var(--auth-blue); text-decoration: none; transition: color .15s ease; }
.auth-link:hover, .auth-link:focus { color: var(--auth-navy); text-decoration: underline; }
.auth-back { display: inline-flex; align-items: center; gap: 7px; margin-top: 18px; }
.auth-back i { transition: transform .2s ease; }
.auth-back:hover i { transform: translateX(-3px); }

/* the main button: lifts on hover, spins while the form is sent */
.auth-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 52px;
    padding: 0 20px;
    font-size: 15.5px;
    font-weight: 600;
    color: #fff;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(120deg, #164b8f 0%, var(--auth-blue) 45%, var(--auth-sky) 100%) 0 0 / 200% 100%;
    box-shadow: 0 8px 20px -6px rgba(29, 111, 209, .55);
    cursor: pointer;
    transition: background-position .4s ease, transform .15s ease, box-shadow .2s ease;
}
.auth-btn:hover { background-position: 100% 0; transform: translateY(-1px); box-shadow: 0 12px 26px -8px rgba(29, 111, 209, .65); }
.auth-btn:active { transform: translateY(1px); box-shadow: 0 4px 12px -6px rgba(29, 111, 209, .6); }
.auth-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(29, 111, 209, .25), 0 8px 20px -6px rgba(29, 111, 209, .55); }
.auth-btn .fa { transition: transform .2s ease; }
.auth-btn:hover .fa-arrow-right, .auth-btn:hover .fa-paper-plane, .auth-btn:hover .fa-key { transform: translateX(4px); }
.auth-btn.is-loading { pointer-events: none; opacity: .9; }
.auth-btn.is-loading .fa { display: none; }
.auth-btn.is-loading::after {
    content: "";
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: authSpin .7s linear infinite;
}

/* ---------- animations ---------- */

@keyframes authRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes authFloat { from { transform: translate(0, 0) scale(1); } to { transform: translate(40px, 30px) scale(1.12); } }
@keyframes authLoop { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -100; } }
@keyframes authSpin { to { transform: rotate(360deg); } }
@keyframes authBreathe { 0%, 100% { opacity: .6; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes authShake {
    0%, 100% { transform: none; }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(3px); }
}

@media (prefers-reduced-motion: reduce) {
    .auth *, .auth *::before, .auth *::after { animation: none !important; transition: none !important; }
}

/* ---------- small screens: the form only, under a brand strip ---------- */

@media (max-width: 991px) {
    .auth { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-foot { display: block; }
    .auth-main { justify-content: flex-start; padding: 0 20px 32px; border-top: 5px solid transparent; border-image: linear-gradient(90deg, var(--auth-navy), var(--auth-sky), var(--auth-cyan)) 1; }
    .auth-card { padding-top: 44px; }
}

@media (max-width: 420px) {
    .auth-title { font-size: 24px; }
    .auth-row { flex-wrap: wrap; }
}
