:root {
    --primary-red: #ff0800;
    --dark-bg: #1c1c1c;
    --card-bg: #ffffff;
    --accent: #f4a261;
    --accent-soft: #ffe3c4;
    --border-soft: #e0e0e0;
    --text-main: #222;
    --text-muted: #666;
    --success: #2e7d32;
    --danger: #c62828;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100vh;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #ff7043 0, var(--primary-red) 40%, #7f0000 100%);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: stretch;
    overflow-x: hidden;
}

.page-wrapper {
    width: 100%;
    max-width: 1450px;
    margin: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    z-index: 2;
}

.demo-display-title {
    width: 100%;
    text-align: center;
    color: #ffffff;
    font-size: clamp(1.45rem, 3.1vw, 2.7rem);
    font-weight: 800;
    line-height: 1.1;
    text-shadow: 0 3px 10px rgba(0,0,0,0.45);
    margin: 0 auto 0.4rem auto;
}

.login-layout {
    width: 100%;
}

.logo-row {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0.25rem 0 0.25rem 0;
}

.logo-row img {
    display: block;
    width: 90%;
    max-width: 380px;
    height: auto;
    margin: 0 auto;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.25rem 1.25rem 1.5rem;
    box-shadow: 0 14px 30px rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.1);
    max-width: 520px;
    width: 100%;
    margin: 0 auto;
}

.card-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1rem;
    text-align: left;
}

.card-title-main {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
}

.card-title-sub {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.status-box {
    border-radius: 10px;
    padding: 0.8rem 0.95rem;
    margin-bottom: 1rem;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.35;
}

.status-box.message {
    background: rgba(46, 125, 50, 0.1);
    color: var(--success);
    border: 1px solid rgba(46, 125, 50, 0.4);
}

.status-box.error {
    background: rgba(198, 40, 40, 0.08);
    color: var(--danger);
    border: 1px solid rgba(198, 40, 40, 0.35);
}

.subtext {
    margin-bottom: 1rem;
    padding: 0.8rem 0.95rem;
    border-radius: 10px;
    background: #fafafa;
    color: var(--text-muted);
    border: 1px solid var(--border-soft);
    font-size: 0.92rem;
    line-height: 1.35;
}

form {
    margin: 0;
    padding: 0;
}

.form-group {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    color: var(--text-muted);
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    color: var(--text-main);
    outline: none;
    transition: border 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
input[type="password"]:focus {
    border-color: var(--dark-bg);
    box-shadow: 0 0 0 3px rgba(28, 28, 28, 0.12);
}

.btn {
    appearance: none;
    border: none;
    border-radius: 999px;
    padding: 0.75rem 1.15rem;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    background: var(--dark-bg);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
    width: 100%;
    min-height: 48px;
    margin-top: 0.25rem;
}

.btn:hover {
    background: #333;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    transform: translateY(-1px);
}

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

.demo-login-card {
    margin-bottom: 1rem;
    padding: 0.8rem 0.95rem;
    border-radius: 10px;
    border: 2px dashed #1c1c1c;
    background: #fffdf3;
    color: #111827;
    font-size: 0.92rem;
    line-height: 1.35;
}

.demo-login-card strong {
    display: block;
    margin-bottom: 0.45rem;
    color: #111827;
}

.demo-credential-line {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

.demo-credential-line span:last-child {
    font-weight: 800;
    letter-spacing: 0.04em;
}

.demo-expire-line {
    margin-top: 0.45rem;
    font-size: 0.8rem;
    color: #4b5563;
}

/* ---------------- DEMO HAMBURGER MENU ---------------- */

.demo-menu-button {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 10px;
    background: #111827;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(0,0,0,0.25);
}

.demo-menu-panel {
    position: fixed;
    top: 74px;
    right: 16px;
    z-index: 9998;
    width: 390px;
    max-width: calc(100vw - 32px);
    background: #ffffff;
    border: 2px solid #111827;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.28);
    padding: 18px;
    display: none;
    color: #111827 !important;
    font-family: Arial, sans-serif;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
}

.demo-menu-panel * {
    color: #111827 !important;
    text-shadow: none !important;
}

.demo-menu-panel.open {
    display: block;
}

.demo-menu-panel h2 {
    margin: 0 0 12px 0;
    font-size: 20px;
    text-align: left;
}

.demo-menu-panel label {
    display: block;
    margin-top: 12px;
    margin-bottom: 4px;
    font-weight: bold;
    font-size: 14px;
    letter-spacing: 0;
    text-transform: none;
}

.demo-menu-panel input[type="text"],
.demo-menu-panel input[type="number"],
.demo-menu-panel input[type="color"],
.demo-menu-panel select {
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    border: 1px solid #9ca3af;
    border-radius: 6px;
    font-size: 14px;
    background: #ffffff;
}

.demo-menu-panel input[type="color"] {
    height: 42px;
    padding: 4px;
}

.demo-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.demo-menu-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.demo-menu-actions button,
.demo-upload-button {
    border: none;
    border-radius: 8px;
    padding: 11px 14px;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
}

.demo-save-btn,
.demo-upload-button {
    background: #0000cd !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.demo-reset-btn {
    background: #6b7280 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.demo-upload-input {
    display: none;
}

.demo-upload-row {
    margin-top: 12px;
}

.demo-upload-button {
    display: block;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}


.demo-upload-filename {
    margin-top: 8px;
    padding: 8px;
    border-radius: 8px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    font-size: 12px;
    line-height: 1.3;
}

.demo-page-message {
    width: 100%;
    max-width: 520px;
    margin: 0 auto 1rem auto;
    padding: 0.8rem 0.95rem;
    border-radius: 10px;
    background: rgba(224, 242, 254, 0.92);
    border: 1px solid #0284c7;
    color: #0f172a;
    font-size: 0.92rem;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 8px 18px rgba(0,0,0,0.22);
}

.demo-disclaimer {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #d97706;
    border-radius: 8px;
    background: #fff7ed;
    font-size: 12px;
    line-height: 1.35;
}

.demo-message {
    margin: 10px 0;
    padding: 8px;
    background: #e0f2fe;
    border: 1px solid #0284c7;
    border-radius: 8px;
    font-size: 13px;
}

.demo-menu-footer {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #d1d5db;
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
}

.demo-footer-button {
    display: block;
    width: 100%;
    box-sizing: border-box;
    border: none;
    border-radius: 8px;
    padding: 12px 14px;
    text-align: center;
    text-decoration: none;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
}

.demo-back-site-button {
    background: #111827 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.demo-contact-site-button {
    background: #991b1b !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.demo-contact-thanks {
    display: none;
    margin-top: 8px;
    padding: 8px;
    border-radius: 8px;
    background: #ecfdf5;
    border: 1px solid #16a34a;
    font-size: 12px;
    line-height: 1.3;
}

.demo-contact-thanks.show {
    display: block;
}

/* ---------------- TUTORIAL OVERLAY ---------------- */

.tutorial-dim {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.52);
    z-index: 20000;
    display: none;
}

.tutorial-highlight {
    position: fixed;
    z-index: 20002;
    border: 3px solid #facc15;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.52), 0 0 22px rgba(250,204,21,0.95);
    pointer-events: none;
    display: none;
}

.tutorial-box {
    position: fixed;
    z-index: 20003;
    width: 340px;
    max-width: calc(100vw - 36px);
    background: #ffffff;
    color: #111827 !important;
    border: 3px solid #111827;
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.35);
    padding: 16px;
    display: none;
    font-family: Arial, sans-serif;
}

.tutorial-box * {
    color: #111827 !important;
    text-shadow: none !important;
}

.tutorial-box::before {
    content: "";
    position: absolute;
    width: 0;
    height: 0;
    border-left: 13px solid transparent;
    border-right: 13px solid transparent;
}

.tutorial-box.arrow-top::before {
    top: -16px;
    left: 32px;
    border-bottom: 16px solid #111827;
}

.tutorial-box.arrow-bottom::before {
    bottom: -16px;
    left: 32px;
    border-top: 16px solid #111827;
}

.tutorial-title {
    font-size: 20px;
    font-weight: bold;
    margin: 0 0 8px 0;
}

.tutorial-text {
    font-size: 15px;
    line-height: 1.35;
    margin-bottom: 14px;
}

.tutorial-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.tutorial-controls button {
    border: none;
    border-radius: 8px;
    padding: 9px 12px;
    font-weight: bold;
    cursor: pointer;
}

.tutorial-prev {
    background: #6b7280;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.tutorial-next {
    background: #0000cd;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.tutorial-counter {
    font-size: 13px;
    color: #374151 !important;
    white-space: nowrap;
}

@media (min-width: 900px) {
    body {
        align-items: center;
    }

    .page-wrapper {
        max-width: 1450px;
        margin: 2rem;
    }

    .login-layout {
        display: grid;
        grid-template-columns: minmax(300px, 420px) 520px;
        align-items: center;
        justify-content: center;
        gap: 2rem;
    }

    .logo-row {
        margin: 0;
        min-height: 320px;
        background: rgba(255,255,255,0.12);
        border: 1px solid rgba(255,255,255,0.28);
        border-radius: 16px;
        box-shadow: 0 12px 28px rgba(0,0,0,0.25);
        backdrop-filter: blur(4px);
    }

    .logo-row img {
        width: 90%;
        max-width: 380px;
    }

    .card {
        max-width: 520px;
        margin: 0;
        padding: 1.5rem 1.6rem 1.7rem;
    }

    .card-title-main {
        font-size: 1.35rem;
    }

    .card-title-sub {
        font-size: 0.95rem;
    }
}

@media (max-width: 899px) {
    body {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 12px;
        background:
            radial-gradient(circle at top, #ff7043 0, var(--primary-red) 40%, #7f0000 100%);
        position: relative;
    }

    body::before {
        content: "";
        position: fixed;
        inset: 0;
        background-image: var(--fire-demo-logo-url);
        background-repeat: no-repeat;
        background-position: center center;
        background-size: min(72.5vw, 380px) auto;
        opacity: 0.88;
        z-index: 0;
        pointer-events: none;
    }

    body::after {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(127, 0, 0, 0.18);
        z-index: 1;
        pointer-events: none;
    }

    .page-wrapper {
        width: 100%;
        min-height: calc(100vh - 24px);
        margin: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 2;
    }

    .demo-display-title {
        margin: 58px auto 0.25rem auto;
        font-size: clamp(1.35rem, 6vw, 2.1rem);
    }

    .login-layout {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .logo-row {
        display: none;
    }

    .card {
        width: 100%;
        max-width: 420px;
        margin: 0 auto;
        background: rgba(255, 255, 255, 0.52);
        border: 1px solid rgba(255, 255, 255, 0.48);
        box-shadow: 0 18px 40px rgba(0,0,0,0.45);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }

    .card-title-main {
        color: #111;
    }

    .card-title-sub,
    label {
        color: #222;
    }

    .subtext,
    .demo-login-card {
        background: rgba(255, 255, 255, 0.72);
        color: #222;
    }

    input[type="text"],
    input[type="password"] {
        background: rgba(255, 255, 255, 0.82);
    }

    .demo-menu-button {
        top: 10px;
        right: 10px;
        width: 44px;
        height: 44px;
        font-size: 25px;
    }

    .demo-menu-panel {
        top: 62px;
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
        max-height: calc(100vh - 76px);
        padding: 14px;
    }

    .demo-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .tutorial-box {
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        max-width: none !important;
        padding: 14px;
    }

    .tutorial-title {
        font-size: 18px;
    }

    .tutorial-text {
        font-size: 14px;
    }
}

@media (max-width: 520px) {
    body {
        padding: 10px;
    }

    body::before {
        background-size: min(92.5vw, 380px) auto;
        background-position: center center;
        opacity: 0.92;
    }

    .page-wrapper {
        min-height: calc(100vh - 20px);
    }

    .card {
        max-width: 390px;
        padding: 1rem 0.9rem 1.2rem;
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.46);
        border: 1px solid rgba(255, 255, 255, 0.40);
    }

    .btn {
        font-size: 0.95em;
        min-height: 44px;
    }

    .demo-login-card .demo-credential-line {
        font-size: 14px;
    }

    .demo-menu-panel h2 {
        font-size: 18px;
    }
}

