/* NMR Events — QR Landing Pages (v2 Dark Theme)
 * Tokens: nmr-tokens.css (loaded via <link> in each HTML page)
 * Used by: index.html (QR handler), error.html, viewer.html
 */

/* Focus styles for accessibility */
:focus-visible {
    outline: 2px solid var(--nmr-accent);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* Prevent double-tap zoom delay */
button, a {
    touch-action: manipulation;
}

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: var(--nmr-text-base);
}

body {
    font-family: var(--nmr-font-display);
    line-height: 1.6;
    color: var(--nmr-text-primary);
    background: var(--nmr-bg-page);
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 10px;
}

.brand-text {
    color: var(--nmr-text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.state {
    background: var(--nmr-bg-surface);
    border: 1px solid var(--nmr-border);
    border-radius: var(--nmr-radius-lg);
    padding: 40px;
    text-align: center;
    box-shadow: var(--nmr-shadow-lg);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hidden {
    display: none !important;
}

/* Loading Spinner */
.loader {
    margin-bottom: 30px;
}

.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--nmr-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Typography */
h2 {
    color: var(--nmr-text-primary);
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.document-name {
    font-size: 1.25rem;
    color: var(--nmr-text-secondary);
    margin-bottom: 20px;
    word-break: break-word;
}

.redirect-notice {
    color: var(--nmr-text-secondary);
    font-size: 0.875rem;
}

/* Warning Banner */
.warning-banner {
    background: var(--nmr-warning);
    color: var(--nmr-bg-page);
    padding: 10px 20px;
    border-radius: var(--nmr-radius-md);
    margin-bottom: 20px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: var(--nmr-space-sm);
}

.warning-icon {
    font-size: 1.25rem;
}

.warning-text {
    color: var(--nmr-text-secondary);
    margin-bottom: 20px;
}

/* Error Styles */
.error-icon {
    width: 60px;
    height: 60px;
    background: var(--nmr-danger);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.5rem;
}

.error-icon.large {
    width: 80px;
    height: 80px;
    font-size: 2rem;
}

.error-text {
    color: var(--nmr-text-secondary);
    margin-bottom: 15px;
}

.error-details {
    font-family: var(--nmr-font-mono);
    background: rgba(255, 255, 255, 0.04);
    padding: 10px;
    border-radius: var(--nmr-radius-sm);
    font-size: 0.875rem;
    color: var(--nmr-text-secondary);
    margin-bottom: 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    min-height: var(--nmr-min-tap-target);
    border-radius: var(--nmr-radius-md);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all var(--nmr-transition-base);
}

.btn-primary {
    background: var(--nmr-accent);
    color: var(--nmr-bg-page);
}

.btn-primary:hover {
    background: var(--nmr-accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--nmr-border);
    color: var(--nmr-text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--nmr-border-hover);
}

/* Contact Text */
.contact-text {
    margin-top: 20px;
    color: var(--nmr-text-secondary);
    font-size: 0.875rem;
}

.contact-text a {
    color: var(--nmr-accent);
    text-decoration: none;
}

.contact-text a:hover {
    text-decoration: underline;
}

/* Error Page */
.error-page {
    background: var(--nmr-bg-surface);
    border: 1px solid var(--nmr-border);
    border-radius: var(--nmr-radius-lg);
    padding: 40px;
    text-align: center;
    box-shadow: var(--nmr-shadow-lg);
}

.error-details-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--nmr-border);
    border-radius: var(--nmr-radius-md);
    padding: 15px;
    margin: 20px 0;
    text-align: left;
}

.error-details-box p {
    margin: 5px 0;
    font-size: 0.875rem;
}

.error-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 25px 0;
    flex-wrap: wrap;
}

.help-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--nmr-border);
    text-align: left;
}

.help-section h3 {
    color: var(--nmr-text-primary);
    margin-bottom: 10px;
}

.help-section ul {
    list-style: none;
    margin: 15px 0;
}

.help-section a {
    color: var(--nmr-accent);
    text-decoration: none;
}

.help-section a:hover {
    text-decoration: underline;
}

.help-note {
    font-size: 0.875rem;
    color: var(--nmr-text-secondary);
    font-style: italic;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 0;
    color: var(--nmr-text-secondary);
    font-size: 0.875rem;
}

.footer-link {
    margin-top: 10px;
}

.footer-link a {
    color: var(--nmr-accent);
    text-decoration: none;
}

.footer-link a:hover {
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .container {
        padding: 20px 15px;
    }

    .state,
    .error-page {
        padding: 25px 20px;
    }

    h2 {
        font-size: 1.25rem;
    }

    .document-name {
        font-size: 1rem;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .error-actions {
        flex-direction: column;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .container {
        padding: 16px 12px;
    }

    .state,
    .error-page {
        padding: 20px 16px;
    }

    h2 {
        font-size: 1.1rem;
    }

    .brand-text {
        font-size: 1.25rem;
    }

    .logo {
        max-width: 150px;
    }
}

/* Print Styles (discourage printing) */
@media print {
    body {
        display: none !important;
    }

    body::before {
        content: "Printing is disabled for this document.";
        display: block;
        padding: 50px;
        text-align: center;
        font-size: 20px;
    }
}
