/* ============================================
   ReadOnce.eu - Self-Destructing Encrypted Notes
   ============================================ */

:root {
    --bg: #0a0a0f;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a25;
    --bg-input: #0d0d14;
    --border: #1e1e2e;
    --border-focus: #6366f1;
    --text: #e4e4e7;
    --text-muted: #71717a;
    --text-dim: #52525b;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --primary-glow: rgba(99, 102, 241, 0.15);
    --danger: #ef4444;
    --danger-hover: #f87171;
    --danger-glow: rgba(239, 68, 68, 0.15);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.08);
    --warning-border: rgba(245, 158, 11, 0.2);
    --info: #6366f1;
    --info-bg: rgba(99, 102, 241, 0.08);
    --info-border: rgba(99, 102, 241, 0.2);
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --shadow: 0 0 0 1px var(--border), 0 4px 24px rgba(0,0,0,0.3);
    --shadow-lg: 0 0 0 1px var(--border), 0 8px 40px rgba(0,0,0,0.5);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    overflow-x: hidden;
}

.noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ---- Header ---- */
.header {
    position: relative;
    z-index: 10;
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    transition: opacity var(--transition);
}

.logo:hover {
    opacity: 0.8;
}

.logo-icon {
    width: 22px;
    height: 22px;
    color: var(--primary);
}

/* ---- Main ---- */
.main {
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* ---- Card ---- */
.card {
    width: 100%;
    max-width: 620px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    animation: fadeUp 0.5s ease-out;
}

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

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

/* ---- Hero ---- */
.hero {
    text-align: center;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), #a78bfa, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.65;
}

.hero-badges {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 20px;
    transition: all var(--transition);
}

.hero-badge svg {
    width: 13px;
    height: 13px;
    color: var(--primary);
    flex-shrink: 0;
}

/* ---- Form ---- */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    padding: 1rem;
    resize: vertical;
    min-height: 140px;
    transition: border-color var(--transition), box-shadow var(--transition);
    line-height: 1.6;
}

.textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

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

.textarea-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.textarea-footer span {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1;
}

.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 20px var(--primary-glow);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 30px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-lg {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border-radius: var(--radius);
}

.btn-secondary {
    width: 100%;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    margin-top: 1rem;
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text);
    border-color: var(--text-dim);
}

.btn-reveal {
    background: var(--primary);
    color: #fff;
    padding: 1rem 2.5rem;
    font-size: 1.05rem;
    border-radius: var(--radius);
    box-shadow: 0 0 30px var(--primary-glow);
}

.btn-reveal:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 50px var(--primary-glow);
    transform: translateY(-2px);
}

.btn-destroy {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 0 20px var(--danger-glow);
}

.btn-destroy:hover {
    background: var(--danger-hover);
    box-shadow: 0 0 30px var(--danger-glow);
    transform: translateY(-1px);
}

.btn-copy {
    background: var(--primary);
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    flex-shrink: 0;
}

.btn-copy:hover {
    background: var(--primary-hover);
}

.btn-copy svg {
    width: 16px;
    height: 16px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ---- How It Works ---- */
.how-it-works {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.section-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 1.25rem;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.9rem 1rem;
    background: rgba(99, 102, 241, 0.04);
    border: 1px solid rgba(99, 102, 241, 0.08);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.step:hover {
    background: rgba(99, 102, 241, 0.07);
    border-color: rgba(99, 102, 241, 0.15);
}

.step-number {
    width: 28px;
    height: 28px;
    min-width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 50%;
    margin-top: 1px;
}

.step-content strong {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.step-content span {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ---- Features ---- */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.6rem;
    padding: 1rem 0.5rem;
    border-radius: var(--radius);
    transition: all var(--transition);
}

.feature:hover {
    background: rgba(99, 102, 241, 0.04);
}

.feature svg {
    width: 22px;
    height: 22px;
    color: var(--primary);
    flex-shrink: 0;
}

.feature strong {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.feature span {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* ---- Shield (Read View) ---- */
.shield {
    text-align: center;
    padding: 1rem 0;
}

.shield-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: var(--primary-glow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 3s ease-in-out infinite;
}

.shield-icon svg {
    width: 40px;
    height: 40px;
    color: var(--primary);
}

.shield h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.shield-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
}

/* ---- Warning Box ---- */
.warning-box {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    text-align: left;
}

.warning-box svg {
    width: 20px;
    height: 20px;
    color: var(--warning);
    flex-shrink: 0;
    margin-top: 1px;
}

.warning-box span {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.warning-box--info {
    background: var(--info-bg);
    border-color: var(--info-border);
}

.warning-box--info svg {
    color: var(--info);
}

/* ---- Note Content ---- */
.note-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.note-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-danger {
    background: var(--danger-glow);
    color: var(--danger);
}

.note-text {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 1.25rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-height: 400px;
    overflow-y: auto;
    animation: fadeIn 0.5s ease-out;
}

.note-actions {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

/* ---- Destroyed State ---- */
.destroyed, .error-state {
    text-align: center;
    padding: 2rem 0;
    animation: fadeIn 0.5s ease-out;
}

.destroyed-icon, .error-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.destroyed-icon {
    background: var(--success-glow);
}

.destroyed-icon svg {
    width: 36px;
    height: 36px;
    color: var(--success);
}

.error-icon {
    background: var(--danger-glow);
}

.error-icon svg {
    width: 36px;
    height: 36px;
    color: var(--danger);
}

.destroyed h2, .error-state h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.destroyed p, .error-state p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* ---- Success State ---- */
.success-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem;
    background: var(--success-glow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-icon svg {
    width: 36px;
    height: 36px;
    color: var(--success);
}

#create-success {
    text-align: center;
    animation: fadeIn 0.4s ease-out;
}

#create-success h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.success-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* ---- Link Box ---- */
.link-box {
    display: flex;
    margin-bottom: 1rem;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.link-input {
    flex: 1;
    background: var(--bg-input);
    border: none;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 0.75rem 1rem;
    min-width: 0;
}

.link-input:focus {
    outline: none;
}

/* ---- Loading ---- */
.loading-state {
    text-align: center;
    padding: 3rem 0;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

.loading-state p, #create-loading p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

#create-loading {
    text-align: center;
    padding: 3rem 0;
}

/* ---- Footer ---- */
.footer {
    position: relative;
    z-index: 10;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
}

.footer-inner {
    max-width: 620px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.footer p {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-decoration: none;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--text-muted);
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .header {
        padding: 1rem 1.25rem;
    }

    .main {
        padding: 1rem;
        align-items: flex-start;
        padding-top: 1.5rem;
    }

    .card {
        padding: 1.5rem;
        border-radius: var(--radius);
    }

    .hero h1 {
        font-size: 1.4rem;
    }

    .hero-badges {
        gap: 0.4rem;
    }

    .hero-badge {
        font-size: 0.65rem;
        padding: 0.3rem 0.6rem;
    }

    .features {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .feature {
        flex-direction: row;
        text-align: left;
        padding: 0.75rem;
    }

    .shield h1 {
        font-size: 1.25rem;
    }

    .btn-reveal {
        width: 100%;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .link-input {
        font-size: 0.7rem;
    }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

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

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

/* ---- Drop Zone ---- */
.drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.drop-zone:hover, .drop-zone--active {
    border-color: var(--primary);
    background: var(--primary-glow);
}

.drop-zone svg {
    width: 28px;
    height: 28px;
    color: var(--text-dim);
    transition: color var(--transition);
}

.drop-zone:hover svg, .drop-zone--active svg {
    color: var(--primary);
}

.drop-zone span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.drop-zone-hint {
    font-size: 0.75rem !important;
    color: var(--text-dim) !important;
}

.label-hint {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-dim);
    font-size: 0.7rem;
}

/* ---- File List ---- */
.file-list {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-item, .file-download-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    animation: fadeIn 0.2s ease-out;
}

.file-icon {
    width: 20px;
    height: 20px;
    color: var(--primary);
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.file-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 0.7rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.file-remove {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all var(--transition);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-remove svg {
    width: 16px;
    height: 16px;
    color: var(--text-dim);
    transition: color var(--transition);
}

.file-remove:hover {
    background: var(--danger-glow);
}

.file-remove:hover svg {
    color: var(--danger);
}

.file-count {
    display: block;
    text-align: right;
    font-size: 0.7rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
    margin-top: 0.35rem;
}

/* ---- Progress Bar ---- */
.progress-container {
    margin-top: 1.25rem;
}

.progress-track {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-hover));
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    text-align: center;
}

/* ---- Read Files ---- */
.read-files {
    margin-top: 1rem;
}

.read-files h3 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.btn-file-download {
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 6px;
    transition: all var(--transition);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.btn-file-download svg {
    width: 16px;
    height: 16px;
}

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

.btn-file-download:disabled {
    opacity: 0.5;
    cursor: wait;
    transform: none;
}

/* ---- Shield File Hint ---- */
.shield-file-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background: var(--info-bg);
    border: 1px solid var(--info-border);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 1.25rem;
}

/* ---- Selection ---- */
::selection {
    background: var(--primary);
    color: #fff;
}
