/* Layer One Secret Share — Custom Styles
   Palette from www.layerone.no */

:root {
    --bg: #111117;
    --card: #1a1a22;
    --accent: #009891;
    --accent-hover: #00a6a6;
    --text-white: #ffffff;
    --text-gray: #c0c3d0;
    --text-muted: #606d75;
    --border: #2a2a35;
    --error: #ef4444;
    --error-light: #f87171;
}

/* --- Reset & base --- */

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text-gray);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Circuit-board fixed background --- */

.circuit-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* --- App container --- */

#app {
    position: relative;
    z-index: 1;
    max-width: 42rem;
    margin: 0 auto;
    padding: 1rem 1rem 4rem;
}

/* --- Header --- */

.lo-header {
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0;
    position: relative;
    z-index: 1;
}

.lo-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 42rem;
    margin: 0 auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.lo-header-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lo-lock-icon {
    width: 2rem;
    height: 2rem;
    color: var(--accent);
    flex-shrink: 0;
}

/* Logo image in header */
.lo-logo {
    height: 2.5rem;
    width: auto;
    display: block;
}

.lo-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.lo-header-link {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.lo-header-link:hover {
    color: var(--accent);
}

/* --- Hero --- */

.lo-hero {
    text-align: center;
    padding: 1.5rem 0 2.5rem;
}

.lo-hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-white);
    margin: 0 0 0.75rem;
    line-height: 1.2;
}

.lo-hero-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.6;
    max-width: 32rem;
    margin-left: auto;
    margin-right: auto;
}

/* --- Main --- */

.lo-main {
    max-width: 42rem;
    margin: 0 auto;
}

/* --- Cards --- */

.lo-card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 0 24px rgba(0, 152, 145, 0.12);
}

/* --- Labels --- */

.lo-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* --- Textarea --- */

.lo-textarea {
    width: 100%;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-white);
    font-family: inherit;
    font-size: 0.9375rem;
    resize: vertical;
    min-height: 8rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.lo-textarea::placeholder {
    color: var(--text-muted);
}

.lo-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 152, 145, 0.25);
}

/* --- Selects row --- */

.lo-selects-row {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.lo-select-group {
    flex: 1;
}

.lo-select-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.lo-select-input {
    width: 100%;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.5rem 0.75rem;
    color: var(--text-white);
    font-family: inherit;
    font-size: 0.875rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    -moz-appearance: textfield;
}

.lo-select-input::-webkit-inner-spin-button,
.lo-select-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.lo-select-input:focus,
.lo-ttl-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 152, 145, 0.25);
}

/* --- TTL value + unit row --- */

.lo-ttl-row {
    display: flex;
    gap: 0.5rem;
}

.lo-ttl-input {
    width: 4.5rem;
    flex-shrink: 0;
}

.lo-ttl-select {
    flex: 1;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23606d75' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

/* --- Primary button --- */

.lo-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background-color: var(--accent);
    color: var(--text-white);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: background-color 0.15s, transform 0.1s, box-shadow 0.15s;
}

.lo-btn-primary:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 0 20px rgba(0, 152, 145, 0.3);
}

.lo-btn-primary:active {
    transform: scale(0.98);
}

.lo-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.lo-btn-primary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* --- Spinner --- */

.lo-spinner {
    width: 1.125rem;
    height: 1.125rem;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.375rem;
}

.lo-btn-spinner {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.hidden {
    display: none !important;
}

/* --- Share link --- */

.lo-share-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.lo-share-input {
    flex: 1;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.5rem 0.75rem;
    color: var(--accent);
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.8125rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lo-share-input:focus {
    outline: none;
    border-color: var(--accent);
}

/* --- Copy button --- */

.lo-btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background-color: var(--border);
    color: var(--text-gray);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.lo-btn-copy:hover {
    background-color: #33333f;
    color: var(--text-white);
}

.lo-btn-copy.copied {
    background-color: rgba(0, 152, 145, 0.15);
    color: var(--accent);
    border-color: var(--accent);
}

.lo-btn-copy:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.lo-copy-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.lo-check-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* --- Error messages --- */

.lo-error {
    border-left: 4px solid var(--error);
    padding: 0.75rem 1rem;
    color: var(--error-light);
    font-size: 0.875rem;
    border-radius: 0 0.5rem 0.5rem 0;
    background-color: rgba(239, 68, 68, 0.08);
}

.lo-error-inline {
    border-left: 4px solid var(--error);
    padding: 0.75rem 1rem;
    color: var(--error-light);
    font-size: 0.875rem;
    border-radius: 0 0.5rem 0.5rem 0;
    background-color: rgba(239, 68, 68, 0.08);
    margin-bottom: 1.5rem;
}

/* --- Status/error views (expired, rate limited, generic error) --- */

.lo-status-view {
    text-align: center;
    padding: 3rem 1rem;
}

.lo-status-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1.5rem;
}

.lo-status-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-white);
    margin: 0 0 0.5rem;
}

.lo-status-subtitle {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin: 0 0 1.5rem;
}

.lo-countdown {
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.lo-error-view {
    text-align: center;
    padding: 3rem 1rem;
}

/* --- Secret display --- */

.lo-secret-display {
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem 2.5rem 1rem 1.25rem;
    color: var(--text-white);
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.9375rem;
    margin: 0;
}

/* --- Secret display wrapper (for inline copy icon) --- */

.lo-secret-wrap {
    position: relative;
}

.lo-secret-copy-btn {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border);
    background-color: var(--card);
    color: var(--text-muted);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
    padding: 0;
}

.lo-secret-copy-btn:hover {
    background-color: #33333f;
    color: var(--text-white);
    border-color: var(--text-muted);
}

.lo-secret-copy-btn.copied {
    background-color: rgba(0, 152, 145, 0.15);
    color: var(--accent);
    border-color: var(--accent);
}

.lo-secret-copy-btn .lo-copy-icon,
.lo-secret-copy-btn .lo-check-icon {
    width: 0.875rem;
    height: 0.875rem;
}

.lo-views-remaining {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

/* --- Key entry view --- */

.lo-key-help-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0 0 1rem;
    line-height: 1.6;
}

.lo-key-help-text code {
    background-color: var(--border);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.8125rem;
    color: var(--accent);
}

.lo-key-input-wrap {
    margin-bottom: 1rem;
}

.lo-key-input {
    width: 100%;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-white);
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 1rem;
    letter-spacing: 0.05em;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.lo-key-input::placeholder {
    color: var(--text-muted);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    letter-spacing: normal;
}

.lo-key-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 152, 145, 0.25);
}

/* --- Links --- */

.lo-link {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: color 0.15s;
}

.lo-link:hover {
    color: var(--accent-hover);
}

.lo-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 2px;
}

/* --- View transitions --- */

.view-transition {
    animation: loFadeIn 0.3s ease-in;
}

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

/* --- Custom scrollbar --- */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* --- Focus outlines (accessibility) --- */

*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* --- Responsive --- */

/* Mobile: <640px */
@media (max-width: 639px) {
    #app {
        max-width: 28rem;
        padding: 3rem 1rem 3rem;
    }

    .lo-hero {
        padding: 1rem 0 2rem;
    }

    .lo-hero-title {
        font-size: 1.75rem;
    }

    .lo-hero-subtitle {
        font-size: 0.875rem;
    }

    .lo-card {
        padding: 1.25rem;
    }

    .lo-selects-row {
        flex-direction: column;
    }

    .lo-header-inner {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .lo-features {
        flex-direction: column;
        padding: 0 1rem;
        gap: 1.5rem;
    }

    .lo-feature-item {
        max-width: 20rem;
        margin: 0 auto;
    }

    .lo-subtitle {
        display: none;
    }
}

/* Tablet and up: >=640px */
@media (min-width: 640px) {
    #app {
        padding: 4rem 1.5rem 4rem;
    }

    .lo-hero {
        padding: 2rem 0 3rem;
    }

    .lo-selects-row {
        flex-direction: row;
    }
}

/* ============================================================
   Features Section
   ============================================================ */

.lo-features {
    max-width: 42rem;
    margin: 1.5rem auto 0;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
    justify-content: center;
}

.lo-feature-item {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 0;
    min-width: 0;
}

.lo-feature-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: rgba(0,152,145,0.08);
    border: 1px solid rgba(0,152,145,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    color: #009891;
}

.lo-feature-title {
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
}

.lo-feature-desc {
    color: #606d75;
    font-size: 0.75rem;
    margin: 0;
    line-height: 1.4;
    min-height: 2.8em;
}

/* ============================================================
   Footer
   ============================================================ */

.lo-footer {
    border-top: 1px solid #2a2a35;
    margin-top: 3rem;
    position: relative;
    z-index: 1;
}

.lo-footer-inner {
    max-width: 42rem;
    margin: 0 auto;
    padding: 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .lo-footer-inner {
        flex-direction: row;
        justify-content: space-between;
    }
}

.lo-footer-text {
    color: #606d75;
    font-size: 0.75rem;
    margin: 0;
}

.lo-footer-badge {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: #606d75;
    font-size: 0.75rem;
}

.lo-badge-dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    background: #009891;
    flex-shrink: 0;
}

/* ============================================================
   Self-destruct note
   ============================================================ */

.lo-selfdestruct-note {
    color: #606d75;
    font-size: 0.75rem;
    margin: 0.75rem 0 0;
}

/* ============================================================
   Warning banner (last view / auto-destroy)
   ============================================================ */

.lo-warning-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background-color: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin-top: 1rem;
}

.lo-warning-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #eab308;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.lo-warning-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #fde047;
    margin: 0 0 0.25rem;
}

.lo-warning-text {
    font-size: 0.8125rem;
    color: #a3a3a3;
    margin: 0;
    line-height: 1.5;
}