/* AMC Secure — premium floating auth panel */

body.auth-body {
    overflow: hidden;
}

body.auth-body .auth-shell {
    position: relative;
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: clamp(10px, 2vw, 18px) !important;
    isolation: isolate;
}

/* Clickable backdrop — full screen close target */
body.auth-body a.auth-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: block;
    overflow: hidden;
    text-decoration: none;
    cursor: pointer;
    background:
        linear-gradient(180deg, rgba(8, 17, 31, 0.82), rgba(8, 17, 31, 0.92)),
        radial-gradient(circle at 18% 12%, rgba(18, 168, 107, 0.34), transparent 32%),
        radial-gradient(circle at 82% 18%, rgba(11, 78, 162, 0.36), transparent 30%),
        linear-gradient(135deg, #08111f, #132238 46%, #071421);
}

body.auth-body .auth-backdrop__grid {
    position: absolute;
    inset: 0;
    opacity: 0.22;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(circle at center, #000 35%, transparent 88%);
}

body.auth-body .auth-backdrop__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(42px);
    opacity: 0.75;
    animation: authOrbFloat 12s ease-in-out infinite;
    pointer-events: none;
}

body.auth-body .auth-backdrop__orb--green {
    top: 12%;
    left: 10%;
    width: 220px;
    height: 220px;
    background: rgba(18, 168, 107, 0.55);
}

body.auth-body .auth-backdrop__orb--blue {
    top: 18%;
    right: 8%;
    width: 260px;
    height: 260px;
    background: rgba(11, 78, 162, 0.5);
    animation-delay: -4s;
}

body.auth-body .auth-backdrop__orb--gold {
    bottom: 8%;
    left: 42%;
    width: 180px;
    height: 180px;
    background: rgba(255, 184, 77, 0.35);
    animation-delay: -7s;
}

@keyframes authOrbFloat {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(0, -18px, 0) scale(1.06); }
}

/* Floating panel */
body.auth-body .auth-panel {
    position: relative;
    z-index: 5;
    width: min(392px, calc(100vw - 22px)) !important;
    max-height: min(88vh, 600px) !important;
    padding: 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.62) !important;
    border-radius: 24px !important;
    background:
        linear-gradient(165deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.78) 48%, rgba(247, 250, 252, 0.72) 100%) !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.95) inset,
        0 28px 70px rgba(2, 8, 23, 0.42),
        0 10px 28px rgba(11, 78, 162, 0.14) !important;
    backdrop-filter: blur(34px) saturate(1.55) brightness(1.04) !important;
    -webkit-backdrop-filter: blur(34px) saturate(1.55) brightness(1.04) !important;
    overflow: hidden !important;
}

body.auth-body .auth-panel--register {
    width: min(480px, calc(100vw - 22px)) !important;
    max-height: min(92vh, 660px) !important;
}

/* Decorative layers — never steal clicks */
body.auth-body .auth-panel::before,
body.auth-body .auth-panel::after,
body.auth-body .auth-panel__fx,
body.auth-body .auth-panel__fx > * {
    pointer-events: none !important;
}

body.auth-body .auth-panel::before {
    display: block !important;
    content: "" !important;
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    padding: 2px;
    background: conic-gradient(
        from var(--auth-edge-angle, 0deg),
        rgba(18, 168, 107, 0.95),
        rgba(143, 255, 103, 0.75),
        rgba(11, 78, 162, 0.9),
        rgba(255, 184, 77, 0.72),
        rgba(18, 168, 107, 0.95)
    );
    filter: drop-shadow(0 0 12px rgba(18, 168, 107, 0.24));
    z-index: 0;
    animation: authEdgeRun 5.2s linear infinite;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

body.auth-body .auth-panel::after {
    inset: 2px !important;
    border-radius: 22px !important;
    background:
        radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.82), transparent 34%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.2)) !important;
    z-index: 0 !important;
}

@keyframes authEdgeRun {
    0% { transform: rotate(0deg); filter: drop-shadow(0 0 10px rgba(18, 168, 107, 0.22)); }
    100% { transform: rotate(360deg); filter: drop-shadow(0 0 12px rgba(11, 78, 162, 0.26)); }
}

body.auth-body .auth-panel__fx {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    border-radius: inherit;
}

body.auth-body .auth-panel__shine {
    position: absolute;
    top: 0;
    left: 8%;
    right: 8%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
}

body.auth-body .auth-panel__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(18px);
    opacity: 0.55;
}

body.auth-body .auth-panel__orb--mint {
    top: -24px;
    left: -18px;
    width: 110px;
    height: 110px;
    background: rgba(18, 168, 107, 0.45);
}

body.auth-body .auth-panel__orb--sky {
    top: 40px;
    right: -28px;
    width: 96px;
    height: 96px;
    background: rgba(11, 78, 162, 0.38);
}

/* Close — full 44px hit target, always on top */
body.auth-body .auth-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 30;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    color: #475569;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    transition: transform 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

body.auth-body .auth-close svg {
    width: 18px;
    height: 18px;
    pointer-events: none;
}

body.auth-body .auth-close:hover,
body.auth-body .auth-close:focus-visible {
    transform: translateY(-1px);
    background: #fff;
    color: #0f172a;
    box-shadow: 0 12px 26px rgba(11, 78, 162, 0.18);
    outline: none;
}

body.auth-body .auth-panel__scroll {
    position: relative;
    z-index: 2;
    max-height: inherit;
    overflow: auto;
    padding: 46px 16px 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(18, 168, 107, 0.45) transparent;
}

body.auth-body .auth-brand {
    gap: 4px;
}

body.auth-body .logo-glow-ring--md {
    width: 68px !important;
    height: 68px !important;
}

body.auth-body .auth-brand img {
    width: 50px !important;
    height: 50px !important;
}

body.auth-body .auth-brand strong {
    margin-top: 2px;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #071421, #0b4ea2 58%, #12a86b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

body.auth-body .auth-brand > span:last-child {
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #64748b;
}

body.auth-body .auth-portal-strip {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 8px 0 2px;
}

body.auth-body .auth-portal-strip span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.62);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.auth-body .auth-tabs {
    gap: 6px;
    margin: 10px 0 12px;
    padding: 5px;
    border-radius: 15px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.58);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

body.auth-body .auth-tabs a {
    padding: 9px 10px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    border-radius: 11px;
    transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

body.auth-body .auth-tabs a.is-active {
    background: linear-gradient(135deg, #071421, #0b4ea2 58%, #12a86b);
    color: #fff;
    box-shadow: 0 10px 22px rgba(11, 78, 162, 0.24);
}

body.auth-body .auth-heading p {
    margin: 0 0 4px;
    font-size: 10px;
    letter-spacing: 0.1em;
}

body.auth-body .auth-heading h1 {
    font-size: 22px !important;
    line-height: 1.08 !important;
    letter-spacing: -0.03em;
}

body.auth-body .auth-heading span {
    max-width: 100%;
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.45;
}

body.auth-body .auth-alert {
    margin-bottom: 4px;
    padding: 9px 11px;
    border-radius: 12px;
    font-size: 12px;
}

body.auth-body .auth-form {
    gap: 9px;
    margin-top: 10px;
}

body.auth-body .auth-form label {
    gap: 5px;
    font-size: 12px;
}

body.auth-body .auth-form input,
body.auth-body .auth-form select {
    min-height: 42px !important;
    border-radius: 13px !important;
    padding: 0 12px;
    border: 1px solid rgba(148, 163, 184, 0.42) !important;
    background: rgba(255, 255, 255, 0.82) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

body.auth-body .auth-form input:focus,
body.auth-body .auth-form select:focus {
    border-color: rgba(18, 168, 107, 0.78) !important;
    background: #fff !important;
    box-shadow: 0 0 0 4px rgba(18, 168, 107, 0.12);
}

body.auth-body .auth-form b {
    font-size: 11px;
    font-weight: 700;
}

body.auth-body .password-field button {
    min-height: 32px;
    padding: 0 11px;
    font-size: 11px;
    z-index: 2;
}

body.auth-body .auth-row {
    gap: 8px;
    font-size: 12px;
}

body.auth-body .auth-form button.auth-submit,
body.auth-body .auth-form button[type="submit"] {
    min-height: 44px;
    margin-top: 4px;
    border: 0;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 900;
    letter-spacing: 0.01em;
    background: linear-gradient(135deg, #071421 0%, #0b4ea2 56%, #12a86b 100%) !important;
    box-shadow:
        0 14px 30px rgba(11, 78, 162, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.22) !important;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

body.auth-body .auth-form button.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow:
        0 18px 34px rgba(11, 78, 162, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.24) !important;
}

body.auth-body .auth-switch {
    margin: 10px 0 0;
    padding-top: 10px;
    font-size: 12px;
}

body.auth-body .auth-secure-note {
    gap: 6px;
    margin-top: 10px;
}

body.auth-body .auth-secure-note span {
    padding: 5px 9px;
    font-size: 9px;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

body.auth-body .auth-form-grid {
    gap: 9px;
}

body.auth-body .auth-form-grid label.wide {
    grid-column: 1 / -1;
}

body.auth-body .auth-help-compact {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
}

body.auth-body .auth-help-compact a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(255, 255, 255, 0.62);
    transition: transform 150ms ease, box-shadow 150ms ease;
}

body.auth-body .auth-help-compact a:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(11, 78, 162, 0.14);
}

@media (max-width: 640px) {
    body.auth-body .auth-shell {
        padding: 10px !important;
    }

    body.auth-body .auth-panel,
    body.auth-body .auth-panel--register {
        width: min(100%, calc(100vw - 16px)) !important;
        max-height: 94vh !important;
        border-radius: 22px !important;
    }

    body.auth-body .auth-panel__scroll {
        padding-inline: 14px;
    }

    body.auth-body .auth-form-grid {
        grid-template-columns: 1fr;
    }

    body.auth-body .auth-tabs a {
        font-size: 11px;
        padding: 8px 6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.auth-body .auth-panel::before,
    body.auth-body .auth-backdrop__orb,
    body.auth-body .auth-panel,
    body.auth-body .logo-glow-ring img {
        animation: none !important;
        transition: none !important;
    }
}
