/*
 * TapIt sign-in pages (login, register, password reset, tag activation and invitation)
 * plus the standalone status pages (errors, tag messages).
 * Loaded by auth/layouts/app.blade.php and partials/status_page.blade.php.
 */
:root {
    --au-ink: #111418;
    --au-muted: #6b7280;
    --au-line: #e5e7eb;
    --au-soft: #f3f4f6;
    --au-bg: #f6f7f9;
    --au-accent: #2563eb;
    --au-danger: #c62839;
    --au-ok: #157347;
    --au-radius: 14px;
    --au-shadow: 0 1px 2px rgba(17, 20, 24, .05), 0 16px 40px rgba(17, 20, 24, .08);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body.auth-body {
    margin: 0; background: var(--au-bg); color: var(--au-ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Split layout ---------- */
.auth-shell { display: grid; grid-template-columns: minmax(380px, 46%) 1fr; min-height: 100vh; }

.auth-brand {
    position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
    padding: 2.5rem 3rem; color: #fff;
    background:
        radial-gradient(1200px 600px at -10% -10%, rgba(99, 102, 241, .35), transparent 60%),
        radial-gradient(900px 500px at 110% 110%, rgba(14, 165, 233, .28), transparent 60%),
        linear-gradient(160deg, #0b0d10 0%, #161a20 55%, #0f1216 100%);
}
.auth-brand::after { /* faint grid */
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
            mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
.auth-brand > * { position: relative; z-index: 1; }
.auth-brand__logo img { height: 40px; width: auto; display: block; }
.auth-brand__copy h1 { font-size: clamp(1.9rem, 2.6vw, 2.6rem); font-weight: 750; letter-spacing: -.02em; line-height: 1.12; margin: 0 0 .85rem; }
.auth-brand__copy h1 span { background: linear-gradient(90deg, #a5b4fc, #7dd3fc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-brand__copy p { color: rgba(255,255,255,.68); font-size: 1rem; line-height: 1.6; max-width: 30rem; margin: 0; }
.auth-points { list-style: none; padding: 0; margin: 1.75rem 0 0; display: grid; gap: .7rem; }
.auth-points li { display: flex; align-items: center; gap: .7rem; color: rgba(255,255,255,.82); font-size: .925rem; }
.auth-points i {
    width: 32px; height: 32px; display: inline-grid; place-items: center; flex: none; font-size: 1.1rem;
    border-radius: 10px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
}
.auth-brand__foot { color: rgba(255,255,255,.45); font-size: .8rem; }

/* The floating NFC card */
.auth-card3d { perspective: 900px; margin: 2.5rem 0; }
.auth-card3d__card {
    position: relative; width: min(360px, 100%); aspect-ratio: 1.586; border-radius: 20px; padding: 1.4rem 1.5rem;
    display: flex; flex-direction: column; justify-content: space-between;
    background: linear-gradient(135deg, #1f2430 0%, #0d0f13 60%, #232937 100%);
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 30px 60px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.08);
    transform: rotateX(10deg) rotateY(-16deg) rotateZ(2deg);
    animation: auth-float 7s ease-in-out infinite;
    overflow: hidden;
}
.auth-card3d__card::before { /* sheen */
    content: ""; position: absolute; inset: -40%;
    background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.12) 50%, transparent 60%);
    animation: auth-sheen 6s ease-in-out infinite;
}
.auth-card3d__top { display: flex; justify-content: space-between; align-items: center; position: relative; }
.auth-card3d__top img { height: 26px; width: auto; }
.auth-card3d__top i { font-size: 1.7rem; color: rgba(255,255,255,.75); transform: rotate(90deg); }
.auth-card3d__chip { width: 44px; height: 34px; border-radius: 7px; background: linear-gradient(135deg, #e8d18f, #b8954a); opacity: .9; position: relative; }
.auth-card3d__name { position: relative; }
.auth-card3d__name strong { display: block; font-size: 1.05rem; letter-spacing: .02em; }
.auth-card3d__name small { color: rgba(255,255,255,.55); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
@keyframes auth-float {
    0%, 100% { transform: rotateX(10deg) rotateY(-16deg) rotateZ(2deg) translateY(0); }
    50% { transform: rotateX(4deg) rotateY(-8deg) rotateZ(0deg) translateY(-10px); }
}
@keyframes auth-sheen { 0%, 30% { transform: translateX(-60%); } 70%, 100% { transform: translateX(60%); } }
@media (prefers-reduced-motion: reduce) {
    .auth-card3d__card, .auth-card3d__card::before { animation: none; }
}

/* ---------- Form side ---------- */
.auth-main { display: flex; flex-direction: column; min-height: 100vh; padding: 1.5rem; }
.auth-main__top { display: flex; justify-content: flex-end; align-items: center; gap: .5rem; font-size: .875rem; color: var(--au-muted); min-height: 40px; }
.auth-main__top a { color: var(--au-ink); font-weight: 650; text-decoration: none; }
.auth-main__top a:hover { text-decoration: underline; }
.auth-main__logo { display: none; margin-right: auto; }
.auth-main__logo img { height: 32px; width: auto; display: block; }
.auth-main__body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 0; }
.auth-panel { width: 100%; max-width: 420px; }
.auth-panel--wide { max-width: 480px; }
.auth-main__foot { text-align: center; color: #9aa3af; font-size: .8rem; }
.auth-main__foot a { color: inherit; }

.auth-head { margin-bottom: 1.75rem; }
.auth-head__icon {
    width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.6rem;
    background: var(--au-ink); color: #fff; margin-bottom: 1.1rem; box-shadow: 0 10px 24px rgba(17,20,24,.18);
}
.auth-head h2 { font-size: 1.75rem; font-weight: 750; letter-spacing: -.02em; margin: 0 0 .4rem; }
.auth-head p { color: var(--au-muted); margin: 0; line-height: 1.55; }
.auth-head p strong { color: var(--au-ink); }

/* Fields */
.auth-form { display: grid; gap: 1.05rem; }
.auth-field label, .auth-label { display: flex; justify-content: space-between; align-items: baseline; font-size: .85rem; font-weight: 650; margin-bottom: .4rem; color: var(--au-ink); }
.auth-field label a { font-weight: 600; color: var(--au-muted); text-decoration: none; font-size: .8rem; }
.auth-field label a:hover { color: var(--au-ink); text-decoration: underline; }
.auth-input { position: relative; }
.auth-input > i {
    position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); font-size: 1.15rem; color: #9aa3af;
    pointer-events: none; transition: color .15s;
}
.auth-input .form-control {
    width: 100%; height: 50px; padding: .65rem 1rem .65rem 2.75rem; font-size: .95rem; color: var(--au-ink);
    background: #fff; border: 1px solid var(--au-line); border-radius: 12px; box-shadow: 0 1px 2px rgba(17,20,24,.04);
    transition: border-color .15s, box-shadow .15s;
}
.auth-input .form-control::placeholder { color: #b0b6bf; }
.auth-input .form-control:focus { outline: 0; border-color: var(--au-ink); box-shadow: 0 0 0 4px rgba(17,20,24,.08); }
.auth-input:focus-within > i { color: var(--au-ink); }
.auth-input .form-control.is-invalid { border-color: var(--au-danger); background-image: none; padding-right: 3rem; }
.auth-input .form-control.is-invalid:focus { box-shadow: 0 0 0 4px rgba(198,40,57,.12); }
.auth-input .form-control[readonly] { background: var(--au-soft); color: var(--au-muted); }
.auth-error { display: flex; gap: .35rem; align-items: center; color: var(--au-danger); font-size: .82rem; margin-top: .4rem; }

/* Show / hide password */
.auth-input--password .form-control { padding-right: 3rem; }
.password-toggle {
    position: absolute; right: .4rem; top: 50%; transform: translateY(-50%); width: 38px; height: 38px;
    display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: #9aa3af;
    font-size: 1.2rem; cursor: pointer; transition: background .15s, color .15s;
}
.password-toggle:hover { background: var(--au-soft); color: var(--au-ink); }
.password-toggle:focus-visible { outline: 3px solid #9aa3af; outline-offset: 1px; }

/* Password strength meter */
.auth-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: .55rem; }
.auth-meter span { height: 4px; border-radius: 4px; background: var(--au-line); transition: background .2s; }
.auth-meter[data-score="1"] span:nth-child(-n+1) { background: #ef4444; }
.auth-meter[data-score="2"] span:nth-child(-n+2) { background: #f59e0b; }
.auth-meter[data-score="3"] span:nth-child(-n+3) { background: #22c55e; }
.auth-meter[data-score="4"] span:nth-child(-n+4) { background: #15803d; }
.auth-hint { color: var(--au-muted); font-size: .8rem; margin-top: .4rem; }
.auth-hint.is-bad { color: var(--au-danger); }

.auth-check { display: flex; align-items: center; gap: .55rem; font-size: .875rem; color: #4b5563; cursor: pointer; user-select: none; }
.auth-check input { width: 18px; height: 18px; accent-color: var(--au-ink); margin: 0; }

/* Buttons */
.auth-btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; width: 100%;
    height: 50px; padding: 0 1.25rem; border-radius: 12px; border: 1px solid var(--au-ink);
    background: var(--au-ink); color: #fff; font-size: .95rem; font-weight: 650; text-decoration: none; cursor: pointer;
    box-shadow: 0 8px 20px rgba(17,20,24,.18); transition: transform .12s, box-shadow .15s, background .15s;
}
.auth-btn:hover { background: #000; color: #fff; box-shadow: 0 12px 26px rgba(17,20,24,.24); }
.auth-btn:active { transform: translateY(1px); }
.auth-btn:focus-visible { outline: 3px solid #9aa3af; outline-offset: 2px; }
.auth-btn i { font-size: 1.2rem; }
.auth-btn--light { background: #fff; color: var(--au-ink); border-color: var(--au-line); box-shadow: 0 1px 2px rgba(17,20,24,.05); }
.auth-btn--light:hover { background: var(--au-soft); color: var(--au-ink); box-shadow: 0 1px 2px rgba(17,20,24,.05); }
.auth-btn--link { background: none; border: 0; box-shadow: none; color: var(--au-muted); height: auto; width: auto; padding: 0; font-weight: 600; }
.auth-btn--link:hover { background: none; color: var(--au-ink); box-shadow: none; text-decoration: underline; }
.auth-btn.is-loading { pointer-events: none; color: transparent !important; }
.auth-btn.is-loading > * { visibility: hidden; }
.auth-btn.is-loading::after {
    content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: auth-spin .7s linear infinite;
}
.auth-btn--light.is-loading::after { border-color: rgba(17,20,24,.2); border-top-color: var(--au-ink); }
@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth-alt { text-align: center; color: var(--au-muted); font-size: .9rem; margin: 1.5rem 0 0; }
.auth-alt a { color: var(--au-ink); font-weight: 650; text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; }
.auth-divider { display: flex; align-items: center; gap: .75rem; color: #9aa3af; font-size: .8rem; margin: .25rem 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--au-line); }

/* Alerts */
.auth-alert { display: flex; gap: .65rem; align-items: flex-start; padding: .8rem .95rem; border-radius: 12px; font-size: .875rem; line-height: 1.45; margin-bottom: 1.1rem; border: 1px solid; }
.auth-alert i { font-size: 1.2rem; flex: none; margin-top: -1px; }
.auth-alert ul { margin: 0; padding-left: 1rem; }
.auth-alert--danger { background: #fdf2f3; border-color: #f7d4d8; color: #9f1d2c; }
.auth-alert--ok { background: #effaf3; border-color: #c9ecd6; color: #11613a; }
.auth-alert--info { background: #f3f6fd; border-color: #d9e2f7; color: #1e3a8a; }

/* Segmented tabs (tag activation / invitation) */
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--au-soft); border-radius: 14px; margin: 0 0 1.4rem; list-style: none; border: 0; }
.auth-tabs .nav-link {
    width: 100%; border: 0; border-radius: 10px; padding: .6rem .75rem; font-size: .9rem; font-weight: 650; color: var(--au-muted);
    background: transparent; display: flex; align-items: center; justify-content: center; gap: .4rem; transition: background .15s, color .15s, box-shadow .15s;
}
.auth-tabs .nav-link:hover { color: var(--au-ink); }
.auth-tabs .nav-link.active { background: #fff; color: var(--au-ink); box-shadow: 0 1px 3px rgba(17,20,24,.12); }

/* Tag summary card */
.auth-tag {
    display: flex; align-items: center; gap: 1rem; padding: 1rem; border-radius: 16px; margin-bottom: 1.4rem;
    background: linear-gradient(135deg, #15181d, #262b35); color: #fff; box-shadow: 0 12px 28px rgba(17,20,24,.18);
}
.auth-tag__icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.5rem; background: rgba(255,255,255,.1); flex: none; }
.auth-tag__body { min-width: 0; flex: 1; }
.auth-tag__body small { display: block; color: rgba(255,255,255,.55); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }
.auth-tag__body strong { display: block; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auth-tag__nums { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .45rem; }
.auth-tag__nums span { font-size: .75rem; padding: .2rem .55rem; border-radius: 999px; background: rgba(255,255,255,.1); color: rgba(255,255,255,.85); font-variant-numeric: tabular-nums; }

.auth-welcome { display: flex; align-items: center; gap: .85rem; padding: .9rem 1rem; border: 1px solid var(--au-line); background: #fff; border-radius: 14px; margin-bottom: 1.1rem; }
.auth-welcome img, .auth-welcome .auth-welcome__avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: none; }
.auth-welcome .auth-welcome__avatar { display: grid; place-items: center; background: var(--au-ink); color: #fff; font-weight: 700; }
.auth-welcome p { margin: 0; font-size: .9rem; color: var(--au-muted); line-height: 1.35; }
.auth-welcome p strong { color: var(--au-ink); display: block; font-size: .95rem; }
.auth-fine { text-align: center; font-size: .8rem; color: #9aa3af; margin: .9rem 0 0; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-main { padding: 1rem 1rem 1.25rem; }
    .auth-main__logo { display: block; }
    .auth-main__body { align-items: flex-start; padding: 1.5rem 0; }
    .auth-main__top .auth-main__top-text { display: none; }
}
@media (max-width: 575.98px) {
    .auth-head h2 { font-size: 1.5rem; }
    .auth-head { margin-bottom: 1.4rem; }
}

/* ---------- Status pages (errors, tag messages) ---------- */
.status-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem 1rem; text-align: center; position: relative; overflow: hidden; }
.status-page::before {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background: radial-gradient(700px 380px at 50% 0%, rgba(99,102,241,.10), transparent 70%);
}
.status-page > * { position: relative; z-index: 1; }
.status-page__logo img { height: 34px; width: auto; display: block; margin: 0 auto 2.25rem; }
.status-card { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--au-line); border-radius: 22px; padding: 2.25rem 1.75rem 1.75rem; box-shadow: var(--au-shadow); }
.status-card__code { font-size: 4.5rem; line-height: 1; font-weight: 800; letter-spacing: -.04em; margin: 0 0 .5rem; background: linear-gradient(180deg, var(--au-ink), #6b7280); -webkit-background-clip: text; background-clip: text; color: transparent; }
.status-card__icon { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 1.1rem; display: grid; place-items: center; font-size: 2rem; background: var(--au-soft); color: var(--au-ink); }
.status-card h1 { font-size: 1.35rem; font-weight: 750; letter-spacing: -.01em; margin: 0 0 .5rem; }
.status-card p { color: var(--au-muted); line-height: 1.6; margin: 0 0 1.5rem; }
.status-card__actions { display: grid; gap: .6rem; }
.status-page__foot { margin-top: 1.75rem; color: #9aa3af; font-size: .8rem; }
