/**
 * ============================================
 * Copyright 2026 DM Atcheh
 * Server/Aplikasi SelfBooth ShiroStudio
 * ============================================
 * DMAuth.css - Stylesheet Authentication & Auth Portals (ShiroStudio Theme)
 */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --glass-bg: rgba(9, 17, 30, 0.85);
    --glass-border: rgba(0, 180, 216, 0.25);
    --glass-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 4px 4px 0px rgba(0, 180, 216, 0.2);
    --accent: #00b4d8;
    --accent-light: #38bdf8;
    --accent-glow: rgba(0, 180, 216, 0.35);
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --input-bg: rgba(12, 22, 38, 0.8);
    --input-border: rgba(0, 180, 216, 0.25);
    --input-focus: rgba(0, 180, 216, 0.4);
    --error: #ef4444;
    --success: #22c55e;
}

html, body {
    height: 100%;
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow-x: hidden;
    background: #060c16;
    color: var(--text);
}

.dm-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.dm-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(6, 12, 22, 0.88) 0%, rgba(9, 17, 30, 0.7) 50%, rgba(6, 12, 22, 0.88) 100%);
}

.dm-particles {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.dm-particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(0, 180, 216, 0.2);
    animation: dmFloat linear infinite;
}

@keyframes dmFloat {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

.dm-auth-wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 440px;
    padding: 20px;
    animation: dmFadeUp 0.6s ease-out;
}

@keyframes dmFadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.dm-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border: 2px solid var(--glass-border);
    border-radius: 8px;
    box-shadow: var(--glass-shadow);
    padding: 36px 32px;
    position: relative;
    overflow: hidden;
}

.dm-glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00b4d8, transparent);
}

.dm-logo-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
    gap: 12px;
}

.dm-logo-wrap img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 6px;
    border: 1.5px solid #00b4d8;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.dm-logo-fallback {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #050a12;
    border: 1.5px solid #050a12;
    box-shadow: 3px 3px 0px var(--accent-light);
}

.dm-logo-fallback svg {
    width: 28px;
    height: 28px;
}

.dm-logo-wrap h1 {
    font-size: 1.35rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    text-align: center;
    color: var(--text);
}

.dm-logo-wrap p {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

.dm-alert {
    padding: 11px 14px;
    border-radius: 6px;
    font-size: 0.82rem;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: dmShake 0.4s ease;
}

@keyframes dmShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.dm-alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1.5px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.dm-alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1.5px solid rgba(34, 197, 94, 0.35);
    color: #86efac;
}

.dm-form-group {
    margin-bottom: 15px;
}

.dm-form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dm-input-wrap {
    position: relative;
}

.dm-input-wrap input {
    width: 100%;
    padding: 12px 14px;
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
}

.dm-input-wrap input::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

.dm-input-wrap input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--input-focus);
    background: rgba(15, 27, 48, 0.9);
}

.dm-input-wrap .dm-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    transition: color 0.2s;
}

.dm-input-wrap .dm-eye:hover {
    color: var(--text);
}

.dm-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.dm-form-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 0.8rem;
}

.dm-form-options label, .dm-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.82rem;
}

.dm-form-options label input[type="checkbox"], .dm-checkbox input[type="checkbox"] {
    accent-color: var(--accent);
    width: 15px;
    height: 15px;
}

.dm-form-options .dm-forgot-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 4px;
    color: #00b4d8;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.8rem;
    background: rgba(0, 180, 216, 0.12);
    border: 1px solid rgba(0, 180, 216, 0.25);
    transition: all 0.2s ease;
}

.dm-form-options .dm-forgot-link:hover {
    background: rgba(0, 180, 216, 0.25);
    color: #38bdf8;
    box-shadow: 0 2px 8px rgba(0, 180, 216, 0.2);
}

.dm-recaptcha-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
    transform: scale(0.92);
    transform-origin: center;
}

.dm-btn {
    width: 100%;
    padding: 13px;
    border: 2px solid #050a12;
    border-radius: 6px;
    background: #00b4d8;
    color: #050a12;
    font-size: 0.9rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 3px 3px 0px #38bdf8;
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.dm-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0px #38bdf8;
    background: #38bdf8;
}

.dm-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    box-shadow: none;
}

.dm-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    box-shadow: none;
    transform: none;
}

.dm-footer {
    text-align: center;
    margin-top: 22px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.dm-footer a {
    color: #00b4d8;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s;
}

.dm-footer a:hover {
    color: #38bdf8;
    text-decoration: underline;
}

.dm-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dm-divider::before, .dm-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(0, 180, 216, 0.2);
}

.dm-auth-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 60px;
    background: rgba(6, 12, 22, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1.5px solid rgba(0, 180, 216, 0.2);
}

.dm-auth-nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #e2e8f0;
    font-weight: 800;
    font-size: 1rem;
    text-transform: uppercase;
}

.dm-auth-nav-brand img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
}

.dm-auth-nav-links {
    display: flex;
    align-items: center;
    gap: 16px;
}

.dm-auth-nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 4px;
    transition: all 0.2s;
}

.dm-auth-nav-links a:hover {
    background: rgba(0, 180, 216, 0.12);
    color: #38bdf8;
}

.dm-auth-nav-links .dm-nav-btn {
    background: #00b4d8;
    color: #050a12 !important;
    font-weight: 800;
    padding: 7px 18px;
    border-radius: 4px;
    border: 1.5px solid #050a12;
    box-shadow: 2px 2px 0px #38bdf8;
}

.dm-auth-nav-links .dm-nav-btn:hover {
    background: #38bdf8;
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0px #38bdf8;
}

.dm-code-input {
    letter-spacing: 0.5em;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 800;
    color: #38bdf8 !important;
}

/* Logout Screen */
.dm-logout-wrap {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2.5rem 2rem;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: 8px;
    box-shadow: var(--glass-shadow);
    max-width: 440px;
    margin: 20px;
}

.dm-logout-wrap h1 {
    font-size: 1.5rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.dm-logout-wrap p {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.dm-logout-countdown {
    font-size: 2.5rem;
    font-weight: 900;
    color: #00b4d8;
    text-shadow: 0 0 20px rgba(0, 180, 216, 0.4);
    margin-bottom: 0.5rem;
}

.dm-flash-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    background: #fff;
    pointer-events: none;
    animation: dmFlash 1.2s ease-out forwards;
}

@keyframes dmFlash {
    0% { opacity: 0; }
    15% { opacity: 1; }
    30% { opacity: 0.92; }
    50% { opacity: 0.3; }
    100% { opacity: 0; }
}

.dm-link-now {
    display: inline-block;
    margin-top: 1.25rem;
    color: #00b4d8;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    transition: color 0.2s;
}

.dm-link-now:hover {
    color: #38bdf8;
    text-decoration: underline;
}

@media (max-width: 480px) {
    .dm-auth-wrapper {
        padding: 14px;
        padding-top: 72px;
    }
    .dm-glass {
        padding: 26px 20px;
    }
    .dm-form-row {
        grid-template-columns: 1fr;
    }
    .dm-auth-nav {
        padding: 0 16px;
    }
    .dm-auth-nav-links a:not(.dm-nav-btn) {
        display: none;
    }
}
