/* Kryptid — matches seecolors.de's "Classic" theme:
   primary #3B82F6, secondary #06B6D4, accent #10B981 (constant across
   both themes — only neutrals/surfaces invert, see variable blocks below). */

/* Reset und Basis-Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── Theme variables ───────────────────────────────────────────────────
   Dark is the default (:root, no attribute needed). An explicit
   [data-theme="light"|"dark"] on <html> — set by app.js after a user
   picks a theme and persisted to localStorage — always wins. Absent
   that choice, prefers-color-scheme decides. Brand/accent/semantic
   colors (blue/cyan/green gradient, error red, warning amber) are NOT
   themed here — they're already legible on both light and dark
   surfaces and stay as literal values throughout the rest of this file. */
:root {
    --bg-body: #020617;
    --bg-surface: #0F172A;
    --bg-surface-alpha: rgba(15, 23, 42, 0.95);
    --bg-input: #1E293B;

    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;
    --text-faint: #64748B;

    --overlay-02: rgba(255, 255, 255, 0.02);
    --overlay-03: rgba(255, 255, 255, 0.03);
    --overlay-04: rgba(255, 255, 255, 0.04);
    --overlay-06: rgba(255, 255, 255, 0.06);
    --overlay-08: rgba(255, 255, 255, 0.08);
    --overlay-10: rgba(255, 255, 255, 0.1);
    --overlay-15: rgba(255, 255, 255, 0.15);

    --shadow-color: rgba(0, 0, 0, 0.35);
    --backdrop-color: rgba(0, 0, 0, 0.85);
    --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

:root[data-theme="light"] {
    --bg-body: #F1F5F9;
    --bg-surface: #FFFFFF;
    --bg-surface-alpha: rgba(255, 255, 255, 0.97);
    --bg-input: #F1F5F9;

    --text-primary: #0F172A;
    --text-secondary: #334155;
    --text-muted: #5B6B80;
    --text-faint: #5F7086;

    --overlay-02: rgba(15, 23, 42, 0.02);
    --overlay-03: rgba(15, 23, 42, 0.035);
    --overlay-04: rgba(15, 23, 42, 0.045);
    --overlay-06: rgba(15, 23, 42, 0.06);
    --overlay-08: rgba(15, 23, 42, 0.08);
    --overlay-10: rgba(15, 23, 42, 0.1);
    --overlay-15: rgba(15, 23, 42, 0.15);

    --shadow-color: rgba(15, 23, 42, 0.12);
    --backdrop-color: rgba(15, 23, 42, 0.6);
    --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B6B80' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --bg-body: #F1F5F9;
        --bg-surface: #FFFFFF;
        --bg-surface-alpha: rgba(255, 255, 255, 0.97);
        --bg-input: #F1F5F9;

        --text-primary: #0F172A;
        --text-secondary: #334155;
        --text-muted: #5B6B80;
        --text-faint: #5F7086;

        --overlay-02: rgba(15, 23, 42, 0.02);
        --overlay-03: rgba(15, 23, 42, 0.035);
        --overlay-04: rgba(15, 23, 42, 0.045);
        --overlay-06: rgba(15, 23, 42, 0.06);
        --overlay-08: rgba(15, 23, 42, 0.08);
        --overlay-10: rgba(15, 23, 42, 0.1);
        --overlay-15: rgba(15, 23, 42, 0.15);

        --shadow-color: rgba(15, 23, 42, 0.12);
        --backdrop-color: rgba(15, 23, 42, 0.6);
        --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B6B80' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-body);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    position: relative;
}

/* Google Material Symbols — ligature font: the icon name as literal text
   renders as the glyph. Variable font axes tuned for a crisp small-UI look
   (rounded style matches the rest of this app's soft, rounded aesthetic). */
.icon-svg {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    color: currentColor;
}

/* Theme toggle — normal in-flow button everywhere (create/dashboard/
   retrieve), inside each page's own .header-top-row. Shows the icon for
   the mode a click switches TO (sun while dark, moon while light),
   matching the convention used by GitHub etc. A previous fixed-position
   version caused two distinct classes of overlap bug: crowding against
   the language switcher/login button in the header on the create page,
   and — worse — permanently covering whatever content scrolled underneath
   it on dashboard/retrieve, since position:fixed doesn't move with the
   page. Normal flow removes both bug classes everywhere at once. */
.theme-toggle {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--overlay-08);
    border: 1px solid var(--overlay-10);
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: var(--overlay-15);
    transform: translateY(-1px);
}

.theme-toggle .icon-dark {
    display: none;
}

:root[data-theme="light"] .theme-toggle .icon-light {
    display: none;
}

:root[data-theme="light"] .theme-toggle .icon-dark {
    display: block;
}

/* Subtle animated background — slow-drifting blurred gradient blobs, well
   below the content in z-index. Purely decorative, never intercepts clicks. */
.bg-animation {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.bg-animation span {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.22;
    will-change: transform;
}

.bg-animation span:nth-child(1) {
    width: 42vw;
    height: 42vw;
    top: -10%;
    left: -8%;
    background: #3B82F6;
    animation: drift1 26s ease-in-out infinite;
}

.bg-animation span:nth-child(2) {
    width: 38vw;
    height: 38vw;
    bottom: -12%;
    right: -6%;
    background: #06B6D4;
    animation: drift2 32s ease-in-out infinite;
}

.bg-animation span:nth-child(3) {
    width: 30vw;
    height: 30vw;
    top: 35%;
    left: 55%;
    background: #10B981;
    animation: drift3 22s ease-in-out infinite;
}

@keyframes drift1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(6vw, 8vh) scale(1.12); }
}

@keyframes drift2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-7vw, -6vh) scale(1.08); }
}

@keyframes drift3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-4vw, 5vh) scale(0.94); }
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Header */
.header {
    background: var(--bg-surface);
    color: var(--text-primary);
    padding: 2rem 2rem;
    text-align: center;
    box-shadow: 0 8px 32px var(--shadow-color);
    margin-bottom: 3rem;
    border-radius: 16px;
    position: relative;
    /* backdrop-filter alone creates a new stacking context (independent of
       z-index/overflow) — .card further down also has backdrop-filter and
       comes later in the DOM, so without an explicit z-index here .header's
       entire subtree (including the z-index:950 language dropdown menu)
       would paint UNDER .card by default same-level DOM-order tie-breaking.
       This explicit z-index elevates .header's own stacking context above
       it, letting the dropdown correctly overlay the page content below. */
    z-index: 5;
    backdrop-filter: blur(10px);
    border: 1px solid var(--overlay-10);
}

/* No overflow:hidden on .header — the language dropdown menu is an
   absolutely-positioned descendant that needs to render past the
   header's own box; its own border-radius (matching the header's top
   corners) keeps this gradient bar looking clipped without needing the
   parent to actually clip anything. */
.header::before {
    border-radius: 16px 16px 0 0;
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3B82F6, #06B6D4, #10B981);
    pointer-events: none;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.logo img {
    height: 150px;
    width: auto;
    transition: all 0.3s ease;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px var(--shadow-color));
}

.logo-link {
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.logo-link:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.logo-link:hover img {
    filter: drop-shadow(0 6px 12px var(--shadow-color));
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(90deg, #3B82F6, #06B6D4);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.85;
    font-weight: 400;
    position: relative;
    z-index: 1;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

/* Main Content */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Cards */
.card, .result-card {
    background: var(--bg-surface);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 40px var(--shadow-color);
    backdrop-filter: blur(10px);
    border: 1px solid var(--overlay-10);
}

.result-card {
    border: 2px solid rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(16, 185, 129, 0.06) 100%);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: var(--overlay-04);
    padding: 0.25rem;
    border-radius: 12px;
    border: 1px solid var(--overlay-08);
}

.tab-button {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    color: var(--text-muted);
}

.tab-button.active {
    background: linear-gradient(135deg, #3B82F6 0%, #06B6D4 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.tab-button:hover:not(.active) {
    background: var(--overlay-06);
    color: var(--text-primary);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Input Groups */
.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Google-style floating-label fields — used only in the login/register
   forms. Pure CSS (no JS): input comes before label in markup so the
   :not(:placeholder-shown) sibling selector can detect content, and each
   input needs placeholder=" " (a literal space) since the trick requires
   a non-empty placeholder attribute to exist at all. */
.floating-input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.floating-input-group input {
    width: 100%;
    padding: 1.35rem 1rem 0.55rem;
    border: 1.5px solid var(--overlay-15);
    border-radius: 10px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.floating-input-group label {
    position: absolute;
    top: 1rem;
    inset-inline-start: 1rem; /* mirrors to the right in dir="rtl" (Arabic) */
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1;
    pointer-events: none;
    transition: all 0.15s ease;
}

.floating-input-group input:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: inset 0 0 0 100px rgba(59, 130, 246, 0.035), 0 0 12px rgba(59, 130, 246, 0.18);
}

.floating-input-group input:focus ~ label,
.floating-input-group input:not(:placeholder-shown) ~ label {
    top: 0.4rem;
    font-size: 0.7rem;
    color: #3B82F6;
}

.input-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--overlay-10);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.2s ease;
    background: var(--bg-input);
    color: var(--text-primary);
}

.input-group textarea:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: inset 0 0 0 100px rgba(59, 130, 246, 0.035), 0 0 12px rgba(59, 130, 246, 0.18);
}

/* File Upload */
.file-upload-area {
    border: 2px dashed var(--overlay-15);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--overlay-02);
}

.file-upload-area:hover {
    border-color: #3B82F6;
    background: rgba(59, 130, 246, 0.06);
}

.file-upload-area.dragover {
    border-color: #06B6D4;
    background: rgba(6, 182, 212, 0.1);
    transform: scale(1.02);
}

.file-upload-icon {
    color: var(--text-faint);
    margin-bottom: 1rem;
    width: 48px;
    height: 48px;
}

.file-upload-area p {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.upload-link {
    color: #3B82F6;
    font-weight: 500;
    text-decoration: underline;
}

.file-info {
    font-size: 0.875rem;
    color: var(--text-faint);
}

/* File Preview */
.file-preview {
    background: var(--overlay-03);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    border: 1px solid var(--overlay-08);
}

.file-info-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.file-name {
    font-weight: 500;
    color: var(--text-primary);
}

.file-size {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.remove-file {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

/* Settings — each field stacks label → input → hint, at every screen
   size, so nothing needs a separate mobile override or a fixed-pixel
   alignment hack for the hint text. */
.settings {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: var(--overlay-02);
    border-radius: 12px;
    border: 1px solid var(--overlay-08);
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-group label {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.4rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* display:inline-flex (not the span default of inline) so width/height
   actually apply — a plain inline element ignores explicit sizing, which
   let the child SVG's own width/height HTML attributes (20px) render at
   their intrinsic size instead of the intended 16px, uneven enough next
   to Arabic text metrics to read as a misaligned icon+label pairing. */
.setting-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.setting-icon .icon-svg {
    width: 100%;
    height: 100%;
}

.setting-group input[type="text"],
.setting-group input[type="email"],
.setting-group input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--overlay-10);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color 0.2s ease;
}

/* Custom chevron (native <select> arrows aren't reliably mirrored to the
   correct side in RTL across browsers) — background-position has no
   logical inline-start/end keyword support yet, so the html[dir="rtl"]
   override below is a deliberate, targeted exception to this file's
   usual logical-properties-only convention for horizontal placement. */
.setting-group select {
    width: 100%;
    padding-block: 0.75rem;
    padding-inline-start: 0.75rem;
    padding-inline-end: 2.5rem;
    border: 2px solid var(--overlay-10);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background-color: var(--bg-input);
    color: var(--text-primary);
    transition: border-color 0.2s ease;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: var(--select-arrow);
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    background-size: 16px;
}

html[dir="rtl"] .setting-group select {
    background-position: left 0.9rem center;
}

.setting-group input:focus,
.setting-group select:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: inset 0 0 0 100px rgba(59, 130, 246, 0.035), 0 0 12px rgba(59, 130, 246, 0.18);
}

.setting-hint {
    display: block;
    color: var(--text-faint);
    font-size: 0.825rem;
    line-height: 1.6;
}

/* Buttons */
.create-button {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #3B82F6 0%, #06B6D4 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35);
}

.create-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.45);
    background: linear-gradient(135deg, #06B6D4 0%, #10B981 100%);
}

.create-button:active {
    transform: translateY(0);
}

.create-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Result Card */
.success-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    color: #10B981;
}

.success-header .icon-svg {
    width: 24px;
    height: 24px;
}

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

.success-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

/* QR Code Section */
.qr-section {
    text-align: center;
    margin-bottom: 2rem;
}

.qr-code {
    display: inline-block;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--shadow-color);
    margin-bottom: 1rem;
}

.qr-info {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Link Section */
.link-section {
    margin-bottom: 2rem;
}

.link-container {
    display: flex;
    gap: 0.5rem;
}

.link-container input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--overlay-10);
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
    background: var(--bg-input);
    color: var(--text-primary);
}

.copy-button {
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #3B82F6 0%, #06B6D4 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

.copy-button:hover {
    background: linear-gradient(135deg, #06B6D4 0%, #10B981 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.45);
}

.copy-button.copied {
    background: linear-gradient(135deg, #10B981 0%, #06B6D4 100%);
}

/* Warning Section */
.warning-section {
    margin-bottom: 2rem;
}

.warning {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 8px;
    color: var(--text-secondary);
}

.warning .icon-svg {
    flex-shrink: 0;
    margin-top: 0.125rem;
    color: #10B981;
}

.warning strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.warning p {
    margin: 0;
    font-size: 0.875rem;
}

/* New Secret Button */
.new-secret-button {
    width: 100%;
    padding: 0.75rem;
    background: transparent;
    color: #3B82F6;
    border: 2px solid #3B82F6;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.new-secret-button:hover {
    background: linear-gradient(135deg, #3B82F6 0%, #06B6D4 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

/* Footer */
.footer {
    margin-top: 3rem;
    text-align: center;
}

/* SEO content — short, genuine explainer text (not just UI chrome) so
   crawlers have real content to index per language. */
.seo-content {
    max-width: 640px;
    margin: 2.5rem auto 0;
    padding: 1.5rem;
    text-align: center;
}

.seo-content h2 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.seo-content p {
    color: var(--text-faint);
    font-size: 0.85rem;
    line-height: 1.7;
}

/* Share widget */
.share-widget {
    text-align: center;
    margin-top: 1.5rem;
}

.share-heading {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--overlay-06);
    border: 1px solid var(--overlay-10);
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.share-btn:hover {
    transform: translateY(-2px);
    color: var(--text-primary);
}

.share-whatsapp:hover { background: #25D366; border-color: #25D366; }
.share-linkedin:hover { background: #0A66C2; border-color: #0A66C2; }
.share-x:hover { background: #000000; border-color: #333; }
.share-email:hover, .share-copy:hover { background: rgba(59, 130, 246, 0.6); border-color: #3B82F6; }

.share-copy.copied {
    background: rgba(16, 185, 129, 0.3);
    border-color: #10B981;
    color: #10B981;
}

/* Language switcher — single button, opens a dropdown menu on click
   (lib/i18n.js's buildLanguageSwitcher()); replaces a 7-code row that
   didn't leave enough room for the other header controls on mobile. */
.language-dropdown {
    position: relative;
}

.language-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    height: 40px;
    background: var(--overlay-06);
    border: 1px solid var(--overlay-15);
    color: var(--text-primary);
    padding: 0 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.language-dropdown-toggle:hover {
    background: var(--overlay-10);
}

.language-dropdown-toggle .icon-svg {
    width: 14px;
    height: 14px;
    transition: transform 0.15s ease;
}

.language-dropdown.open .language-dropdown-toggle .icon-svg {
    transform: rotate(180deg);
}

.language-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.4rem);
    inset-inline-end: 0; /* mirrors to the left edge in dir="rtl" (Arabic) */
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--overlay-15);
    border-radius: 10px;
    box-shadow: 0 8px 24px var(--shadow-color);
    padding: 0.4rem;
    min-width: 110px;
    z-index: 950;
}

.language-dropdown.open .language-dropdown-menu {
    display: flex;
}

.lang-dropdown-link {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.lang-dropdown-link:hover {
    background: var(--overlay-06);
    color: var(--text-primary);
}

.lang-dropdown-link.active {
    color: #3B82F6;
    font-weight: 600;
}

/* Dashboard user menu — consolidates email, Settings, and Logout (previously
   three separately-floating header elements) into one button that opens a
   dropdown, mirroring the .language-dropdown pattern above. */
.user-menu {
    position: relative;
}

.user-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 40px;
    max-width: 220px;
    background: var(--overlay-06);
    border: 1px solid var(--overlay-15);
    color: var(--text-primary);
    padding: 0 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-menu-toggle:hover {
    background: var(--overlay-10);
}

.user-menu-toggle .icon-svg {
    flex-shrink: 0;
}

.user-menu-toggle .icon-svg:last-child {
    transition: transform 0.15s ease;
}

.user-menu.open .user-menu-toggle .icon-svg:last-child {
    transform: rotate(180deg);
}

.user-menu-email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-dropdown {
    display: none;
    flex-direction: column;
    position: absolute;
    top: calc(100% + 0.4rem);
    inset-inline-end: 0;
    background: var(--bg-surface);
    border: 1px solid var(--overlay-15);
    border-radius: 10px;
    box-shadow: 0 8px 24px var(--shadow-color);
    padding: 0.4rem;
    min-width: 190px;
    z-index: 950;
}

.user-menu.open .user-menu-dropdown {
    display: flex;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.65rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-align: start;
    transition: all 0.15s ease;
}

.user-menu-item:hover {
    background: var(--overlay-06);
    color: var(--text-primary);
}

.user-menu-item-danger:hover {
    color: #F87171;
}

.security-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.security-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    opacity: 0.9;
}

.security-item .icon-svg {
    color: #10B981;
    width: 16px;
    height: 16px;
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--overlay-15), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem 0.5rem;
        margin: 0;
    }

    .header {
        padding: 1rem;
        margin-bottom: 2rem;
    }

    .card, .result-card {
        padding: 1.5rem 1rem;
        margin: 0 0.5rem;
    }

    .logo {
        flex-direction: column;
        gap: 0.5rem;
        padding-left: 0;
        text-align: center;
    }

    .logo img {
        height: 45px;
        margin-right: 0;
    }

    .logo h1 {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .security-info {
        gap: 1rem;
        flex-direction: column;
        align-items: center;
    }

    .security-item {
        font-size: 0.85rem;
        justify-content: center;
    }

    .link-container {
        flex-direction: column;
        gap: 1rem;
    }

    .file-upload-area {
        padding: 2rem 1rem;
        min-height: 120px;
    }

    .tabs {
        gap: 0.5rem;
    }

    .tab {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

}

@media (max-width: 480px) {
    .container {
        padding: 0.5rem 0.25rem;
    }

    .header {
        padding: 0.75rem 0.5rem;
        margin-bottom: 1.5rem;
    }

    .card, .result-card {
        padding: 1rem 0.75rem;
        margin: 0 0.25rem;
    }

    .tabs {
        flex-direction: column;
        gap: 0.25rem;
    }

    .tab {
        padding: 0.75rem;
        text-align: center;
    }

    .security-info {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .file-upload-area {
        padding: 1.5rem 0.75rem;
        min-height: 100px;
    }

    .setting-group input,
    .setting-group select,
    .setting-group textarea {
        font-size: 16px; /* Verhindert Zoom auf iOS */
    }

    button {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        min-height: 44px; /* Touch-freundliche Mindestgröße */
    }
}

/* Sehr kleine Bildschirme */
@media (max-width: 320px) {
    .container {
        padding: 0.25rem;
    }

    .card, .result-card {
        padding: 0.75rem 0.5rem;
        margin: 0;
    }

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

    .subtitle {
        font-size: 0.8rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

/* Secret display styles */
.secret-display {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--bg-surface-alpha);
    border-radius: 16px;
    box-shadow: 0 20px 40px var(--shadow-color);
    backdrop-filter: blur(10px);
    border: 1px solid var(--overlay-10);
}

.logo-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--overlay-10);
}

.logo-header .logo-link {
    display: inline-block;
    transition: all 0.3s ease;
    text-decoration: none;
}

.logo-header .logo-link h2 {
    background: linear-gradient(90deg, #3B82F6, #06B6D4);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.logo-header .logo {
    transition: all 0.3s ease;
    filter: drop-shadow(0 4px 8px var(--shadow-color));
}

.logo-header .logo-link:hover .logo {
    transform: scale(1.05);
    filter: drop-shadow(0 6px 12px var(--shadow-color)) brightness(1.1);
}

/* Footer on the retrieve page's rendered result — reaches recipients who
   may never have visited the create page themselves. */
.powered-by-footer {
    text-align: center;
    color: var(--text-faint);
    font-size: 0.8rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--overlay-08);
}

.powered-by-footer a {
    color: #06B6D4;
    text-decoration: none;
    font-weight: 500;
}

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

.powered-by-footer .icon-svg {
    width: 14px;
    height: 14px;
}

/* Non-blocking marketing CTA on the create-success screen */
.marketing-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.marketing-cta p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.marketing-cta .icon-svg {
    width: 18px;
    height: 18px;
    color: #fbbf24;
}

.marketing-cta a {
    flex-shrink: 0;
    background: linear-gradient(135deg, #3B82F6 0%, #06B6D4 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

/* Login Modal */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--backdrop-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.login-content {
    background: var(--bg-surface);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 20px 40px var(--shadow-color);
    border: 1px solid var(--overlay-10);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.login-content h2 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.login-content p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.login-submit {
    width: 100%;
    background: linear-gradient(135deg, #3B82F6 0%, #06B6D4 100%);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35);
}

.login-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.45);
    background: linear-gradient(135deg, #06B6D4 0%, #10B981 100%);
}

.login-submit:active {
    transform: translateY(0);
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    padding: 0.8rem;
    border-radius: 8px;
    margin-top: 1rem;
    border: 1px solid rgba(239, 68, 68, 0.3);
    font-size: 0.9rem;
}

.account-back-link {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.4rem 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.account-back-link:hover {
    color: var(--text-primary);
}

/* Header's top row — theme toggle on one side, language dropdown +
   login/auth-status on the other, all normal in-flow flex items instead
   of independently fixed-position pieces (see .theme-toggle comment). */
.header-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    position: relative;
    z-index: 2;
}

/* Compact corner brand mark — small logo top-left instead of the old
   large centered hero title, standard app-header layout rather than a
   landing-page hero. .logo/.logo h1 (used elsewhere, e.g. the retrieve
   page's success screen) are untouched; this is a distinct, smaller
   variant scoped to the header's own top row. */
.header-brand h1 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(90deg, #3B82F6, #06B6D4);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.header-utility-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Same 40px height as .theme-toggle/.language-dropdown-toggle so all
   three header controls align cleanly in a row — scoped to this
   context only, not the base .account-open-button (reused with its own
   sizing by the dashboard's 2FA enable/disable buttons). */
.header-utility-right .account-open-button {
    height: 40px;
}

/* Account entry point (header, logged-out state) */
.account-entry {
    display: flex;
}

.account-open-button {
    background: var(--overlay-06);
    color: var(--text-primary);
    border: 1px solid var(--overlay-15);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
}

.account-open-button:hover {
    background: var(--overlay-10);
    transform: translateY(-1px);
}

.account-open-button .icon-svg {
    width: 18px;
    height: 18px;
}

/* Account modal: login/register tabs */
.modal-close {
    position: absolute;
    top: 0.75rem;
    inset-inline-end: 0.75rem; /* mirrors to the left automatically in dir="rtl" (Arabic) */
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close .icon-svg {
    width: 18px;
    height: 18px;
}

.modal-close:hover {
    background: var(--overlay-08);
    color: var(--text-primary);
}

.account-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--overlay-04);
    padding: 0.25rem;
    border-radius: 12px;
    border: 1px solid var(--overlay-08);
}

.account-tab {
    flex: 1;
    padding: 0.6rem 1rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-muted);
}

.account-tab.active {
    background: linear-gradient(135deg, #3B82F6 0%, #06B6D4 100%);
    color: white;
}

.account-form {
    display: none;
    text-align: start; /* flips to right-aligned in dir="rtl" (Arabic) */
}

.account-form.active {
    display: block;
}

.account-hint {
    color: var(--text-faint);
    font-size: 0.8rem;
    line-height: 1.6;
    margin-top: 1.25rem;
    text-align: start; /* flips to right-aligned in dir="rtl" (Arabic) */
}

/* Dashboard */
.dashboard-section-title {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dashboard-section-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.danger-zone {
    border-color: rgba(239, 68, 68, 0.25);
    margin-top: 1rem;
}

.danger-zone .dashboard-section-title {
    color: #f87171;
}

.danger-button {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

.danger-button:hover {
    background: rgba(239, 68, 68, 0.2);
}

.dashboard-empty-text {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem 0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge .icon-svg {
    width: 14px;
    height: 14px;
}

.status-pending { background: rgba(59, 130, 246, 0.15); color: #60A5FA; }
.status-accessed { background: rgba(16, 185, 129, 0.15); color: #34D399; }
.status-expired { background: rgba(148, 163, 184, 0.15); color: var(--text-muted); }
.status-revoked { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.totp-status-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.totp-setup-grid {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.totp-qr {
    width: 180px;
    height: 180px;
    border-radius: 12px;
    background: white;
    padding: 0.5rem;
    flex-shrink: 0;
}

.totp-setup-details {
    flex: 1;
    min-width: 240px;
}

.totp-manual-key {
    display: block;
    background: var(--bg-input);
    border: 1px solid var(--overlay-10);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    color: #06B6D4;
    margin-bottom: 1rem;
    word-break: break-all;
}

.totp-setup-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.totp-setup-actions button {
    flex: 1;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-item {
    background: var(--overlay-02);
    border: 1px solid var(--overlay-08);
    border-radius: 10px;
    padding: 1rem;
}

.history-item-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

/* Live countdown ring on pending history items — a depleting radial
   progress ring (ticked every second from dashboard.js) rather than just
   a static "expires at" timestamp. Turns red and pulses once the secret
   is close to expiring (last 10% of its lifetime, or under 5 minutes). */
.countdown-ring {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.countdown-ring svg {
    position: absolute;
    top: 0;
    left: 0;
}

.countdown-track {
    stroke: var(--overlay-10);
}

.countdown-progress {
    stroke: #10B981;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}

.countdown-ring.countdown-critical .countdown-progress {
    stroke: #ef4444;
    animation: countdown-pulse 1s ease-in-out infinite;
}

@keyframes countdown-pulse {
    0%, 100% { filter: drop-shadow(0 0 1px #ef4444); }
    50% { filter: drop-shadow(0 0 5px #ef4444); }
}

.countdown-text {
    position: relative;
    font-size: 0.62rem;
    font-weight: 700;
    font-family: 'Monaco', 'Menlo', monospace;
    color: var(--text-primary);
}

.history-label {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.history-item-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    color: var(--text-faint);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.history-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-revoke-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-revoke-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Icon-only — a distinct, permanent "remove from history" action separate
   from Widerrufen/revoke above (which only kills the live secret and keeps
   the record). Available on every item, not just pending ones. */
.history-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    color: var(--text-faint);
    border: 1px solid var(--overlay-15);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.history-delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

@media (max-width: 480px) {
    .totp-setup-grid {
        flex-direction: column;
        align-items: center;
    }
    .totp-status-row {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }

    .bg-animation {
        display: none;
    }

    .container {
        max-width: none;
        margin: 0;
        padding: 1rem;
    }

    .card, .result-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .login-modal, .auth-status {
        display: none !important;
    }
}
