@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow: hidden !important;
    width: 100%;
    height: 100%;
}

body {
    width: 100%;
    height: 100%;
    overflow: hidden !important;
    scrollbar-width: none;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #050818;
}

body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* ── Background Video ────────────────────────────────────────────── */
.background-container {
    position: fixed;
    inset: 0;
    z-index: 1;
}

#bgVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
    z-index: 0;
    filter: brightness(1.05) contrast(1.02);
}

#robotCanvas {
    width: 100%;
    height: 100%;
    display: block;
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.overlay {
    position: absolute;
    inset: 0;
    background: transparent;
    pointer-events: none;
}

/* ── Sound Toggle ────────────────────────────────────────────────── */
.audio-toggle-btn-floating {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 200;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    padding: 8px 18px;
    border-radius: 50px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
}

.audio-toggle-btn-floating:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* ── Auth Container ───────────────────────────────────────────────── */
.auth-container {
    position: fixed;          /* fixed so it never causes scroll */
    inset: 0;
    z-index: 10;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 20px 20px 20px 6%;
    overflow: hidden;
}

/* ── Form Wrapper ─────────────────────────────────────────────────── */
.form-wrapper {
    background: rgba(12, 15, 35, 0.72);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-radius: 28px;
    padding: 36px 38px;
    width: 100%;
    max-width: 420px;
    /* Never allow ANY scrollbar — form content always fits the login card */
    overflow: hidden;
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.10);
    animation: slideUp 0.55s cubic-bezier(0.16, 1, 0.3, 1);
    transition: box-shadow 0.3s ease;
    /* Suppress every possible scrollbar indicator */
    scrollbar-width: none;
}

.form-wrapper::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.form-wrapper:hover {
    box-shadow:
        0 40px 100px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(255, 255, 255, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.form-wrapper.hidden {
    display: none;
}

/* Registration form has more fields — allow vertical scroll ONLY on very short viewports */
#registerForm {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 40px);
    scrollbar-width: none;
}

#registerForm::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(32px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

/* ── Accent divider under logo ───────────────────────────────────── */
.form-divider {
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
    margin: 14px auto 0;
}

/* ── Form Header ─────────────────────────────────────────────────── */
.form-header {
    text-align: center;
    margin-bottom: 28px;
}

.form-header h1 {
    color: #fff;
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.form-header p {
    color: rgba(255, 255, 255, 0.55);
    font-size: 14px;
    font-weight: 400;
}

/* ── Registration Form Compact overrides ─────────────────────────── */
#registerForm {
    padding: 26px 32px;
}

#registerForm .form-header {
    margin-bottom: 18px;
}

#registerForm .form-header h1 {
    font-size: 22px;
}

#registerForm .form-header p {
    font-size: 13px;
}

#registerForm .input-group {
    margin-bottom: 12px;
}

#registerForm .input-group label {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}

#registerForm .input-group input {
    padding: 9px 14px;
    font-size: 13.5px;
    border-radius: 10px;
}

#registerForm .go-button {
    padding: 11px;
    margin-top: 6px;
    font-size: 14.5px;
    border-radius: 10px;
}

#registerForm .form-footer {
    margin-top: 14px;
}

#registerForm .form-footer p {
    font-size: 13px;
}

/* ── Input Group ─────────────────────────────────────────────────── */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    color: rgba(255, 255, 255, 0.80);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 7px;
    letter-spacing: 0.2px;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 12px;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.25s ease;
    outline: none;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.28);
}

.input-group input:focus {
    background: rgba(102, 126, 234, 0.10);
    border-color: rgba(102, 126, 234, 0.65);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.18);
}

/* ── Remember Me ─────────────────────────────────────────────────── */
.remember-me {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.70);
    font-size: 13.5px;
    cursor: pointer;
}

.remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #667eea;
    border-radius: 4px;
    flex-shrink: 0;
}

.remember-me label {
    cursor: pointer;
    user-select: none;
}

/* ── GO / Register Button ────────────────────────────────────────── */
.go-button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-family: inherit;
    font-size: 15.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    position: relative;
    overflow: hidden;
}

.go-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.go-button:hover::before { opacity: 1; }

.go-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.5);
}

.go-button:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ── Form Footer ─────────────────────────────────────────────────── */
.form-footer {
    text-align: center;
    margin-top: 22px;
}

.form-footer p {
    color: rgba(255, 255, 255, 0.60);
    font-size: 13.5px;
}

.form-footer a {
    color: #a78bfa;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.25s ease;
}

.form-footer a:hover {
    color: #fff;
    text-decoration: underline;
}

/* ── Popup ───────────────────────────────────────────────────────── */
.popup {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.popup.show { display: flex; }

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.popup-content {
    background: rgba(18, 22, 50, 0.96);
    backdrop-filter: blur(24px);
    padding: 42px 40px 36px;
    border-radius: 24px;
    text-align: center;
    max-width: 380px;
    width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.10);
    animation: popupSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
}

@keyframes popupSlide {
    from { transform: scale(0.85) translateY(-16px); opacity: 0; }
    to   { transform: scale(1)    translateY(0);     opacity: 1; }
}

.popup-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
}

.popup-icon.success {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: #fff;
    box-shadow: 0 8px 24px rgba(56, 239, 125, 0.35);
}

.popup-icon.success::before { content: '✓'; }

.popup-icon.error {
    background: linear-gradient(135deg, #eb3349, #f45c43);
    color: #fff;
    box-shadow: 0 8px 24px rgba(235, 51, 73, 0.35);
}

.popup-icon.error::before { content: '✕'; }

.popup-content p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    line-height: 1.65;
    margin-bottom: 26px;
}

.popup-close {
    padding: 12px 42px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.popup-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.45);
}

/* ── Loading Spinner on Button ───────────────────────────────────── */
.go-button.loading {
    pointer-events: none;
    opacity: 0.85;
}

.go-button.loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin: -9px 0 0 -9px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spinner 0.75s linear infinite;
}

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

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .auth-container {
        justify-content: center;
        padding: 16px;
    }

    .form-wrapper {
        padding: 28px 24px;
        max-width: 100%;
        border-radius: 22px;
    }

    #registerForm {
        padding: 22px 20px;
    }

    .form-header h1 { font-size: 22px; }
    .form-header p  { font-size: 13px; }

    .input-group input {
        padding: 10px 14px;
        font-size: 13.5px;
    }

    .go-button { padding: 12px; font-size: 15px; }

    .popup-content { padding: 30px 24px; }
    .popup-icon    { width: 60px; height: 60px; font-size: 30px; }
}

@media (max-height: 700px) {
    .form-header  { margin-bottom: 14px; }

    #registerForm { padding: 16px 20px; }
    #registerForm .input-group          { margin-bottom: 8px; }
    #registerForm .input-group input    { padding: 8px 12px; font-size: 13px; }
    #registerForm .go-button            { padding: 10px; font-size: 14px; }
}

@media (max-width: 480px) {
    .auth-container { padding: 14px; }

    .form-wrapper {
        padding: 28px 18px;
        border-radius: 20px;
    }

    .form-header h1 { font-size: 22px; }
    .input-group    { margin-bottom: 16px; }
    .input-group label { font-size: 12.5px; }
    .input-group input { padding: 11px 14px; font-size: 14px; }
    .go-button      { font-size: 14.5px; }

    .popup-content  { padding: 26px 18px; }
    .popup-content p { font-size: 14px; }
}
