/* ══════════════════════════════════════
   BRODI 3.0 AUTH PAGES - ELEGANT REDESIGN
   Inherits brodi-3.0.css variables
   ══════════════════════════════════════ */

/* ══════════════════════════════════════
   TAILWIND UTILITY REPLACEMENTS
   Replaces cdn.tailwindcss.com for auth pages
   ══════════════════════════════════════ */

/* Layout */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.hidden        { display: none !important; }
.relative      { position: relative; }
.absolute      { position: absolute; }
.fixed         { position: fixed; }
.inset-0       { inset: 0; }
.overflow-hidden { overflow: hidden; }

/* Flex Alignment */
.items-center    { align-items: center; }
.items-start     { align-items: flex-start; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.shrink-0        { flex-shrink: 0; }

/* Gap */
.gap-2  { gap: 0.5rem; }
.gap-3  { gap: 0.75rem; }
.gap-4  { gap: 1rem; }
.gap-8  { gap: 2rem; }

/* Spacing — Margin */
.mt-4   { margin-top: 1rem; }
.mt-6   { margin-top: 1.5rem; }
.mt-12  { margin-top: 3rem; }
.mb-1   { margin-bottom: 0.25rem; }
.mb-2   { margin-bottom: 0.5rem; }
.mb-4   { margin-bottom: 1rem; }
.mb-6   { margin-bottom: 1.5rem; }
.mb-8   { margin-bottom: 2rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Spacing — Padding */
.p-4    { padding: 1rem; }
.px-10  { padding-left: 2.5rem; padding-right: 2.5rem; }
.pt-4   { padding-top: 1rem; }

/* Sizing */
.w-px   { width: 1px; }
.h-px   { height: 1px; }
.w-3    { width: 0.75rem; }
.h-3    { height: 0.75rem; }
.w-4    { width: 1rem; }
.h-4    { height: 1rem; }
.w-5    { width: 1.25rem; }
.h-5    { height: 1.25rem; }
.h-1    { height: 0.25rem; }
.w-10   { width: 2.5rem; }
.h-10   { height: 2.5rem; }
.w-24   { width: 6rem; }
.h-24   { height: 6rem; }
.w-64   { width: 16rem; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }
.m-0    { margin: 0; }
.p-0    { padding: 0; }

/* Border */
.border-t  { border-top: 1px solid; }
.border-2  { border-width: 2px; }
.border-t-transparent { border-top-color: transparent; }
.border-blue-500 { border-color: #3b82f6; }
.rounded-full { border-radius: 9999px; }
.rounded-3xl  { border-radius: 1.5rem; }
.rounded-2xl  { border-radius: 1rem; }
.rounded-xl   { border-radius: 0.75rem; }

/* Typography */
.text-center    { text-align: center; }
.text-white     { color: #ffffff; }
.text-xs        { font-size: 0.75rem; line-height: 1rem; }
.text-sm        { font-size: 0.875rem; line-height: 1.25rem; }
.text-xl        { font-size: 1.25rem; line-height: 1.75rem; }
.text-3xl       { font-size: 1.875rem; line-height: 2.25rem; }
.font-bold      { font-weight: 700; }
.font-black     { font-weight: 900; }
.uppercase      { text-transform: uppercase; }
.tracking-widest  { letter-spacing: 0.1em; }
.leading-relaxed  { line-height: 1.625; }

/* Colors — Text */
.text-blue-400  { color: #60a5fa; }
.text-blue-500  { color: #3b82f6; }
.text-red-400   { color: #f87171; }
.text-red-500   { color: #ef4444; }

/* Colors — Background */
.bg-gray-800      { background-color: #1f2937; }
.bg-blue-500      { background-color: #3b82f6; }
.bg-blue-600\/20  { background-color: rgba(37, 99, 235, 0.2); }
.bg-red-500\/20   { background-color: rgba(239, 68, 68, 0.2); }
.bg-blue-500\/10  { background-color: rgba(59, 130, 246, 0.1); }
.bg-red-500\/20   { background-color: rgba(239, 68, 68, 0.2); }

/* Z-index */
.z-10     { z-index: 10; }
.z-\[9999\] { z-index: 9999; }

/* Space between children */
.space-y-0\.5 > * + * { margin-top: 0.125rem; }

/* Transitions & Animations */
.transition-colors   { transition: color 0.15s, background-color 0.15s, border-color 0.15s; }
.transition-all      { transition: all 0.15s; }
.duration-1000       { transition-duration: 1000ms; }
.animate-pulse       { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.animate-ping        { animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; }
.animate-spin        { animation: spin-tw 1s linear infinite; }
.animate-bounce      { animation: bounce 1s infinite; }
.animate-none        { animation: none; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}
@keyframes ping {
    75%, 100% { transform: scale(2); opacity: 0; }
}
@keyframes spin-tw {
    to { transform: rotate(360deg); }
}
@keyframes bounce {
    0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(0.8,0,1,1); }
    50%       { transform: none; animation-timing-function: cubic-bezier(0,0,0.2,1); }
}

/* Responsive — xl:block (min-width: 1280px) */
@media (min-width: 1280px) {
    .xl\:block { display: block !important; }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    /* Lock scroll on desktop by default */
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ── Elegant Mesh Background ───────────────── */
.auth-mesh-container {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: var(--bg-base);
}

.mesh-layer {
    position: absolute;
    width: 150vw;
    height: 150vh;
    top: -25vh;
    left: -25vw;
    background:
        radial-gradient(circle at 20% 30%, var(--accent) 0%, transparent 45%),
        radial-gradient(circle at 80% 70%, var(--mesh-b) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, var(--accent-light) 0%, transparent 55%);
    filter: blur(100px);
    opacity: 0.7;
    /* boosted from 0.4 */
    animation: drift 30s infinite linear;
}

.mesh-layer-2 {
    background:
        radial-gradient(circle at 70% 20%, var(--mesh-b) 0%, transparent 40%),
        radial-gradient(circle at 30% 80%, var(--accent) 0%, transparent 40%);
    animation: drift 45s infinite linear reverse;
    opacity: 0.4;
    /* boosted from 0.2 */
}

@keyframes drift {
    0% {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(180deg) scale(1.1);
    }

    100% {
        transform: rotate(360deg) scale(1);
    }
}

/* ── Tech Grid Overlay ─────────────────────── */
.tech-grid {
    position: fixed;
    inset: 0;
    z-index: 1;
    background-image: radial-gradient(var(--border-strong) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.1));
    pointer-events: none;
    opacity: 0.3;
}

/* ── Layout ────────────────────────────────── */
.auth-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 10;
}

/* Left: Branding Panel */
.auth-branding {
    flex: 0.9;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 clamp(2rem, 4vw, 5rem) 4rem;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #0f172a 100%);
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.25);
    animation: brandingIn 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes brandingIn {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

[data-theme="dark"] .auth-branding {
    background: linear-gradient(135deg, #020617 0%, #0f172a 50%, #020617 100%);
}

.auth-branding::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.branding-content {
    position: relative;
    z-index: 10;
    margin-top: -10vh;
    /* Move entire branding section up */
}

.branding-logo-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 3rem;
    animation: logoPop 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s both;
}

@keyframes logoPop {
    from {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }

    to {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

.branding-logo-glow {
    position: absolute;
    inset: -60px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    filter: blur(20px);
    animation: pulseGlow 4s infinite ease-in-out;
}

@keyframes pulseGlow {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.2);
    }
}

.branding-logo {
    position: relative;
    height: 120px;
    /* Increased from 100px */
    width: auto;
    filter: brightness(0) invert(1) drop-shadow(0 0 20px rgba(255, 255, 255, 0.6));
    animation: float 6s ease-in-out infinite;
}



.branding-title {
    font-size: clamp(2rem, 2.8vw, 3.5rem);
    font-weight: 950;
    color: #ffffff;
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.branding-title span {
    display: block;
    font-size: clamp(1.6rem, 2.2vw, 2.75rem);
    background: linear-gradient(to right, #93c5fd, #ffffff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.9;
    margin-top: 0.25rem;
}

.branding-subtitle {
    font-size: clamp(0.85rem, 1vw, 1.125rem);
    color: rgba(255, 255, 255, 0.7);
    max-width: 520px;
    line-height: 1.6;
    font-weight: 400;
}

/* Right: Form Section */
.auth-form-section {
    flex: 1.1;
    display: flex;
    padding: clamp(1rem, 2vw, 2rem);
    background: transparent;
    align-items: center;
    justify-content: center;
    position: relative;
}

.auth-card {
    width: 100%;
    max-width: clamp(360px, 30vw, 480px);
    background: var(--bg-nav);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1.5px solid var(--border-strong);
    border-radius: 2rem;
    padding: clamp(1.75rem, 2.5vh, 2.5rem) clamp(1.5rem, 2.5vw, 3rem);
    box-shadow: var(--shadow-lg), 0 20px 50px rgba(0, 0, 0, 0.05);
    animation: cardIn 1s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 5;
}

.auth-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 3.2rem;
    padding: 2px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent, rgba(255, 255, 255, 0.05));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

/* ── Form Items ────────────────────────────── */
.auth-header {
    margin-bottom: 2rem;
    /* Reduced from 2.5rem */
    text-align: left;
}

.auth-title {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
    /* Reduced from 1.75rem */
}

.form-label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.auth-input {
    width: 100%;
    background: var(--bg-surface2) !important;
    border: 1.5px solid var(--border);
    border-radius: 1.25rem;
    padding: 1rem 1.25rem;
    color: var(--text-primary) !important;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    outline: none;
}

.input-wrapper .auth-input[type="password"],
.input-wrapper .auth-input[type="text"] {
    padding-right: 3.5rem;
}

.toggle-password {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    transition: all 0.3s ease;
    z-index: 10;
}

.toggle-password:hover {
    color: var(--accent);
}

.auth-input:focus {
    border-color: var(--accent);
    background: var(--bg-surface) !important;
    box-shadow: 0 0 0 5px var(--accent-light);
    transform: translateY(-1px);
}

/* ── Custom Security Indicator ──────────────── */
.security-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    margin: 1.5rem 0 1rem;
    transition: all 0.4s ease;
}

.security-indicator.verified {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.4);
}

.status-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.status-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(130, 170, 255, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.status-check {
    color: #22c55e;
    width: 18px;
    height: 18px;
}

.status-text {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

.security-indicator.verified .status-spinner {
    display: none;
}

.security-indicator.verified .status-text {
    color: #22c55e;
}

/* KONTROL VISIBILITAS TURNSTILE */
.hidden-turnstile {
    height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s ease;
}

#turnstile-wrapper:not(.hidden-turnstile) {
    height: auto;
    opacity: 1;
    pointer-events: auto;
    padding: 0.5rem 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.auth-btn {
    width: 100%;
    padding: 1rem 1.25rem;
    /* Slightly reduced height */
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 1.125rem;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px -5px rgba(59, 90, 184, 0.4);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.auth-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-3px);
    box-shadow: 0 20px 35px -10px rgba(59, 90, 184, 0.5);
}

.auth-btn:active {
    transform: translateY(-1px);
}

.auth-options {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.auth-link {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.auth-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.auth-link:hover {
    opacity: 0.8;
}

.auth-link:hover::after {
    width: 100%;
}

/* ── Error States ──────────────────────────── */
.input-error {
    border-color: var(--red) !important;
}

.input-error:focus {
    box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.15) !important;
}

.error-msg {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--red);
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 0.5rem;
    padding-left: 0.25rem;
    animation: fadeIn 0.3s ease-out;
}

.error-msg i {
    stroke-width: 2.5;
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 1024px) {
    .auth-container {
        flex-direction: column;
        min-height: 100vh;
        overflow-y: auto;
    }

    .auth-branding {
        flex: none;
        padding: 6rem 2rem 4rem; /* Increased top padding */
        text-align: center;
        align-items: center;
        box-shadow: none;
        border-bottom: 1px solid var(--border-strong);
    }

    .branding-content {
        margin-top: 0; /* Neutralized negative margin for mobile */
    }

    .branding-title {
        font-size: 2.5rem;
    }

    .branding-title span {
        font-size: 2rem;
    }

    .branding-subtitle {
        font-size: 1rem;
        margin-inline: auto;
        opacity: 0.8;
    }

    .branding-logo {
        height: 80px;
    }

    .auth-form-section {
        padding: 3rem 1.5rem 5rem;
        min-height: auto;
        flex: 1;
        display: block;
    }

    .auth-card {
        margin: 0 auto;
        padding: 2.5rem 2rem;
        border-radius: 2rem;
        max-width: 480px;
        box-shadow: var(--shadow-md);
        background: var(--bg-surface);
        backdrop-filter: none;
        border: 1px solid var(--border);
    }

    .auth-header {
        text-align: center;
    }
}

@media (max-width: 640px) {
    .auth-branding {
        padding: 4rem 1.5rem 3rem;
    }

    .auth-form-section {
        padding: 2rem 1rem 4rem;
    }

    .auth-card {
        padding: 2.25rem 1.5rem;
        border-radius: 1.75rem;
    }

    .auth-title {
        font-size: 1.85rem;
    }

    .branding-title {
        font-size: 2.25rem;
    }
}

@media (max-width: 480px) {
    .auth-branding {
        padding: 4rem 1.5rem 3rem;
    }

    .auth-form-section {
        padding: 2rem 1rem;
    }

    .auth-card {
        padding: 2rem 1.25rem;
    }

    .auth-title {
        font-size: 1.75rem;
    }
}

.auth-footer {
    position: absolute;
    bottom: 2rem;
    left: 4rem;
    z-index: 50;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    pointer-events: none;
}

[data-theme="dark"] .auth-footer {
    color: rgba(255, 255, 255, 0.2);
}

.auth-options label {
    transition: all 0.3s ease;
}

.auth-options label:hover {
    color: var(--accent) !important;
}

.auth-options input[type="checkbox"] {
    transition: all 0.3s ease;
    cursor: pointer;
}

.auth-options input[type="checkbox"]:hover {
    transform: scale(1.1);
}

@media (max-width: 1024px) {
    .auth-footer {
        position: relative;
        bottom: auto;
        left: auto;
        padding: 3rem 1.5rem;
        text-align: center;
        width: 100%;
        color: var(--text-muted);
        background: var(--bg-base);
    }
}

@media (max-width: 1024px) {
    body {
        overflow-y: auto;
    }
}

/* ══════════════════════════════════════════
   DESKTOP RESPONSIVE — PC Scaling
   Menyesuaikan untuk berbagai ukuran monitor
   ══════════════════════════════════════════ */

/* Laptop kecil: 1025px – 1280px */
@media (min-width: 1025px) and (max-width: 1280px) {
    .auth-branding {
        flex: 0.85;
    }
    .auth-form-section {
        flex: 1.15;
    }
    .branding-logo {
        height: 90px;
    }
}

/* Monitor standar: 1281px – 1536px (default, sudah di-handle clamp) */

/* Monitor besar: 1537px – 1920px */
@media (min-width: 1537px) and (max-width: 1920px) {
    .auth-branding {
        flex: 1;
        padding: 0 clamp(4rem, 5vw, 7rem) 4rem;
    }
    .auth-form-section {
        flex: 1;
    }
    .branding-logo {
        height: 140px;
    }
    .branding-logo-wrapper {
        margin-bottom: 3.5rem;
    }
}

/* 4K / Ultra-wide: 1921px+ */
@media (min-width: 1921px) {
    .auth-container {
        max-width: 2200px;
        margin: 0 auto;
    }
    .auth-branding {
        flex: 1;
        padding: 0 8rem 4rem;
    }
    .auth-form-section {
        flex: 1;
    }
    .auth-card {
        max-width: 520px;
    }
    .branding-logo {
        height: 160px;
    }
    .branding-logo-wrapper {
        margin-bottom: 4rem;
    }
}