/* style.css - MocTel Secure Share */

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    max-width: 640px;
    margin: 0 auto;
    padding: 0 16px 40px;
    background: #f5f7fa;
    color: #1a1a2e;
    line-height: 1.5;
    font-size: 15px;
}

/* Header */
.site-header {
    padding: 16px 0;
    margin-bottom: 24px;
    border-bottom: 1px solid #e0e4ea;
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.site-logo {
    font-weight: 700;
    font-size: 17px;
    color: #0066b8;
    text-decoration: none;
}
.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
.theme-select {
    font-size: 13px;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #555;
    cursor: pointer;
    width: auto;
}
.lang-toggle {
    font-size: 13px;
    color: #555;
    text-decoration: none;
    padding: 4px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    transition: background 0.2s;
}
.lang-toggle:hover { background: #e9ecef; }

/* Container */
.container {
    max-width: 640px;
    margin: 0 auto;
}

/* Typography */
h1 { font-size: 22px; font-weight: 700; margin: 0 0 12px; color: #1a1a2e; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 10px; color: #333; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 8px; color: #444; }
.text-muted { color: #6c757d; }
.text-sm { font-size: 13px; }

/* Cards */
.card {
    background: #fff;
    border: 1px solid #e0e4ea;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}
.card-error {
    border-color: #f5c6cb;
    background: #fff5f5;
}
.card-muted {
    background: #f8f9fa;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-error {
    background: #fff0f0;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}
.alert-warn {
    background: #fff8e1;
    color: #856404;
    border: 1px solid #ffeeba;
    text-align: center;
}
.alert p { margin: 0; }
.warn-header {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 6px;
}
.warn-line {
    font-size: 14px;
    line-height: 1.6;
}

/* Forms */
.form-group {
    margin-bottom: 14px;
}
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: #333;
}
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="password"],
input[type="datetime-local"],
textarea,
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccd0d5;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.2s;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #0066b8;
    box-shadow: 0 0 0 3px rgba(0,102,184,0.1);
}
textarea { resize: vertical; }
.mono { font-family: 'SF Mono', Monaco, Consolas, monospace; font-size: 13px; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #0066b8;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s;
    line-height: 1.4;
}
.btn:hover { background: #005299; }
.btn-primary { background: #0066b8; }
.btn-primary:hover { background: #005299; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-full { display: block; width: 100%; }
.btn-danger { background: #c0392b; }
.btn-danger:hover { background: #a93226; }
/* Download button after the file has been grabbed (visual progress cue) */
.dl-btn.dl-done { background: #1e8e3e !important; }
.dl-btn.dl-done:hover { background: #1b7d37 !important; }
input[type="submit"], button {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    background: #0066b8;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}
input[type="submit"]:hover, button:hover {
    background: #005299;
}

/* Copy row */
.copy-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.copy-row input {
    flex: 1;
    min-width: 0;
}
.copy-row .btn { white-space: nowrap; flex-shrink: 0; }

/* Options */
.option-label {
    display: block;
    margin: 6px 0;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s;
}
.option-label:hover { background: #f0f4f8; }
.option-label input[type="radio"],
.option-label input[type="checkbox"] {
    margin-right: 8px;
    vertical-align: middle;
}
.option-label strong { font-weight: 600; }

/* Errors */
.error { color: #c0392b; }
.success { color: #27ae60; }

/* Content display */
.frame {
    position: relative;
    border: 1px solid #e0e4ea;
    border-radius: 6px;
    padding: 16px;
    margin: 12px 0;
    background: #fafbfc;
    overflow: auto;
}
.watermarked-content {
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 50px, rgba(200, 0, 0, 0.03) 50px, rgba(200, 0, 0, 0.03) 100px);
    background-size: 100px 100px;
    position: relative;
    min-height: 100px;
    padding: 16px;
    margin: 12px 0;
    border: 1px solid #e0e4ea;
    border-radius: 8px;
}
.watermarked-content::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Ctext transform='translate(50 90) rotate(-45)' text-anchor='middle' font-family='Arial,sans-serif' font-size='12' fill='rgba(200,0,0,0.08)'%3Econfidential%3C/text%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 100px 100px;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}
.watermarked-content > * { position: relative; z-index: 1; }
pre {
    padding: 12px;
    border: 1px solid #e0e4ea;
    border-radius: 4px;
    white-space: pre-wrap;
    margin: 0;
    font-size: 13px;
    background: #fff;
    line-height: 1.5;
}

/* Files */
details {
    margin: 10px 0;
    border: 1px solid #e0e4ea;
    border-radius: 6px;
    overflow: hidden;
}
summary {
    cursor: pointer;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
    padding: 12px 16px;
    background: #fafbfc;
    font-size: 14px;
}
summary:hover { background: #f0f4f8; }
details[open] > summary { border-bottom: 1px solid #e0e4ea; }
details > :not(summary) { padding: 12px 16px; }
.download-right { margin-left: 10px; }
.file-hash {
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 12px;
    color: #888;
    margin: 5px 0;
}

/* Drop zone */
.drop-zone {
    border: 2px dashed #ccd0d5;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    margin: 12px 0;
    background: #fafbfc;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.drop-zone:hover { border-color: #0066b8; background: #f0f7ff; }
.drop-zone.dragover { background: #e3f2fd; border-color: #0066b8; }
.drop-zone p { margin: 4px 0; }

/* File list */
.file-list { margin: 8px 0; }
.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid #e0e4ea;
    border-radius: 6px;
    margin-bottom: 4px;
    background: white;
    font-size: 13px;
}
.file-item button {
    background: #dc3545;
    padding: 3px 8px;
    font-size: 14px;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    line-height: 1;
}
.file-item button:hover { background: #c82333; }
.viewable-checkbox {
    margin-left: 10px;
    display: flex;
    align-items: center;
    font-size: 12px;
}
.viewable-checkbox input[type="checkbox"] { margin-right: 5px; }
#fileInput { margin: 8px 0; }

/* Logs */
.logs { font-size: 13px; color: #555; }
.log-entry {
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: baseline;
}
.log-entry:last-child { border-bottom: none; }
.log-action { font-weight: 600; color: #333; }
.log-time { color: #888; font-size: 12px; }
.log-ip { font-family: monospace; font-size: 12px; color: #888; }
.log-detail { color: #666; font-size: 12px; }

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    color: white;
}
.badge-muted { background: #6c757d; }

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #27ae60;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.4s;
    font-size: 14px;
    font-weight: 600;
}
.toast.show { opacity: 1; }

/* Countdown */
#countdown, #expiry-countdown {
    font-weight: 700;
    color: #c0392b;
}

/* Puzzle */
#puzzle {
    display: inline-grid;
    grid-template-columns: repeat(3, 100px);
    grid-template-rows: repeat(3, 100px);
    gap: 2px;
    background-color: #333;
    padding: 2px;
    border: 2px solid #1a1a2e;
    border-radius: 4px;
    position: relative;
}
.puzzle-center {
    text-align: center;
    margin: 12px 0;
    padding-top: 56px; /* room for speech bubble above */
}
.tile {
    background-size: 300px 300px;
    background-repeat: no-repeat;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: rgba(0,0,0,0.7);
    transition: transform 0.18s ease-out;
    position: relative;
}
.tile:hover:not(.empty) { transform: scale(1.04); }
.tile.empty { background: none !important; cursor: default; font-size: 0; }
.tile.movable { background-color: rgba(0,200,0,0.12); }
.tile.sliding {
    z-index: 5;
    transition: transform 0.15s ease-out;
}
.puzzle-locked .tile {
    pointer-events: none;
    cursor: default;
}
.puzzle-locked .tile.movable {
    background-color: transparent;
}
.puzzle-locked .tile:hover {
    transform: none;
}
.tile.dragging {
    z-index: 5;
    cursor: grabbing;
    transition: none !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
#status, #testStatus { margin-top: 10px; font-weight: 600; font-size: 14px; text-align: center; }
.puzzle-status:empty { display: none; }

/* Password style config */
.pw-config {
    margin-top: 4px;
}
.pw-styles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 12px;
}
.pw-style-option {
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    border: 2px solid #e0e4ea;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    text-align: center;
}
.pw-style-option:hover { background: #f8fafc; border-color: #ccd0d5; }
.pw-style-option.active { border-color: #0066b8; background: #f0f7ff; }
.pw-style-name {
    font-weight: 700;
    font-size: 13px;
    color: #333;
}
.pw-style-desc {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}
.pw-preview {
    margin-bottom: 8px;
}
.pw-preview-label {
    font-size: 11px;
    color: #888;
    margin-bottom: 4px;
}
.pw-example code {
    display: block;
    background: #f5f5f5;
    border: 1px dashed #d0d0d0;
    border-radius: 6px;
    padding: 10px 14px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 15px;
    font-weight: 500;
    color: #999;
    letter-spacing: 0.5px;
    word-break: break-all;
    text-align: center;
    transition: opacity 0.2s;
}
.pw-custom-wrap {
    margin-top: 8px;
}
.pw-custom-wrap input {
    font-size: 15px;
}
.input-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220,53,69,0.15) !important;
    animation: inputShake 0.3s ease;
}
@keyframes inputShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-3px); }
}
.pw-case-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e8ecf0;
    cursor: pointer;
}
.pw-case-toggle input { margin: 0; }
@media (max-width: 380px) {
    .pw-styles { grid-template-columns: 1fr; }
}

/* PIN entry (6-digit verification style) */
.pin-entry {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 16px 0 4px;
}
.pin-input {
    width: 48px !important;
    height: 60px;
    text-align: center;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 26px !important;
    font-weight: 800;
    color: #1a1a2e;
    border: 2px solid #ccd0d5 !important;
    border-radius: 10px !important;
    padding: 0 !important;
    caret-color: #0066b8;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: #fff !important;
}
.pin-input:focus {
    border-color: #0066b8 !important;
    box-shadow: 0 0 0 3px rgba(0,102,184,0.15) !important;
    outline: none;
}
/* Error state: red borders + shake */
.pin-entry.shake .pin-input {
    border-color: #dc3545 !important;
}
.pin-entry.shake {
    animation: pinShake 0.4s ease;
}
.btn:disabled, button:disabled, input[type="submit"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn-loading {
    opacity: 0.7 !important;
    pointer-events: none;
}
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes pinShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}
@media (max-width: 380px) {
    .pin-input { width: 40px !important; height: 50px; font-size: 22px !important; }
    .pin-entry { gap: 5px; }
}

/* Retrieve confirm page */
.retrieve-hero {
    text-align: center;
    padding: 20px 0 8px;
}
.retrieve-hero-icon {
    font-size: 52px;
    line-height: 1;
    margin-bottom: 12px;
}
.retrieve-hero h1 {
    font-size: 22px;
    margin-bottom: 8px;
}
.retrieve-info-card {
    border: 1px solid #e0e4ea;
    background: #fafbfc;
}
.retrieve-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.retrieve-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 8px;
}
.retrieve-info-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}
.retrieve-info-detail {
    min-width: 0;
}
.retrieve-info-value {
    font-weight: 700;
    font-size: 14px;
    color: #1a1a2e;
}
.retrieve-info-sub {
    font-size: 12px;
    color: #888;
    margin-top: 1px;
}
/* Single-use warning banner */
.single-use-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff5f5;
    border: 1px solid #f5c6cb;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 16px;
}
.single-use-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}
.single-use-text {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}
.single-use-text strong {
    display: block;
    font-size: 14px;
    color: #c0392b;
    margin-bottom: 2px;
}

.btn-reveal {
    font-size: 16px !important;
    padding: 14px 24px !important;
    margin-top: 8px;
}

/* Single-use download grace window (countdown shown on content screen) */
.grace-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff8e6;
    border: 1px solid #f0d488;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
}
.grace-banner .grace-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}
.grace-text {
    display: flex;
    flex-direction: column;
    line-height: 1.4;
}
.grace-text strong {
    font-size: 15px;
    color: #8a6d00;
}
.grace-text #graceCountdown {
    font-variant-numeric: tabular-nums;
}
.grace-sub {
    font-size: 12px;
    color: #777;
    margin-top: 2px;
}
.grace-banner.grace-closed {
    background: #fdecea;
    border-color: #f5c6cb;
}
.grace-banner.grace-closed strong {
    color: #c0392b;
}
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 480px) {
    .retrieve-info-grid { grid-template-columns: 1fr; }
}

/* Puzzle speech bubble (shown after demo) */
.puzzle-bubble {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    color: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    z-index: 20;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    line-height: 1.4;
}
/* Arrow pointing down */
.puzzle-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    margin-left: -10px;
    border: 10px solid transparent;
    border-top-color: #1a1a2e;
    border-bottom: none;
}
.puzzle-bubble-icon {
    font-size: 16px;
    vertical-align: middle;
    margin-right: 4px;
}
/* Animations */
.puzzle-bubble.bubble-in {
    animation: bubbleIn 0.4s ease-out;
}
.puzzle-bubble.bubble-out {
    animation: bubbleOut 0.4s ease-in forwards;
}
@keyframes bubbleIn {
    0% { opacity: 0; transform: translateX(-50%) translateY(10px) scale(0.9); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes bubbleOut {
    0% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-8px) scale(0.95); }
}

/* Hint flash for auto-solver nudge */
.hint-flash {
    animation: hintFlash 0.6s ease-in-out 2;
    z-index: 3;
}
@keyframes hintFlash {
    0% { box-shadow: 0 0 0 0 rgba(255,200,0,0); }
    30% { box-shadow: 0 0 0 6px rgba(255,200,0,0.7); transform: scale(1.06); }
    60% { box-shadow: 0 0 0 3px rgba(255,200,0,0.3); transform: scale(1); }
    100% { box-shadow: 0 0 0 0 rgba(255,200,0,0); }
}
.demo-hint { font-weight: 400; font-size: 12px; color: #888; }
.demo-target {
    position: relative;
    z-index: 2;
    animation: demoPulse 0.8s ease-in-out;
}
/* Ripple ring expanding outward */
.demo-target::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 30px; height: 30px;
    margin: -15px 0 0 -15px;
    border-radius: 50%;
    border: 3px solid rgba(0,102,184,0.6);
    animation: demoRipple 0.8s ease-out;
    pointer-events: none;
    z-index: 3;
}
/* Finger pointer */
.demo-target::after {
    content: '👆';
    position: absolute;
    bottom: -8px;
    right: -4px;
    font-size: 48px;
    line-height: 1;
    animation: demoPoint 0.8s ease-in-out;
    pointer-events: none;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.5));
    z-index: 4;
}
@keyframes demoPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0,102,184,0.3); }
    40% { transform: scale(1.06); box-shadow: 0 0 12px 4px rgba(0,102,184,0.2); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0,102,184,0); }
}
@keyframes demoRipple {
    0% { width: 20px; height: 20px; margin: -10px 0 0 -10px; opacity: 1; }
    100% { width: 90px; height: 90px; margin: -45px 0 0 -45px; opacity: 0; border-width: 2px; }
}
@keyframes demoPoint {
    0% { opacity: 0; transform: translateY(10px) scale(0.6); }
    25% { opacity: 1; transform: translateY(0) scale(1.1); }
    40% { transform: translateY(-2px) scale(1); }
    75% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-6px) scale(0.8); }
}

/* Mode toggle */
.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.upload-header h1 { margin-bottom: 0; }
.mode-toggle {
    display: flex;
    border: 1px solid #ccd0d5;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}
.mode-btn {
    padding: 6px 14px !important;
    font-size: 13px !important;
    background: #f5f7fa !important;
    color: #555 !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    font-weight: 500 !important;
    cursor: pointer;
    transition: all 0.15s;
}
.mode-btn:hover { background: #e9ecef !important; }
.mode-btn.active {
    background: #0066b8 !important;
    color: #fff !important;
}

/* Wizard progress */
.wizard-progress {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin: 0 0 24px;
    padding: 16px 0;
    position: relative;
    counter-reset: wiz;
}
/* Connector line behind the circles */
.wizard-progress::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: #dde1e7;
    z-index: 0;
}
.wiz-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 1;
    padding: 0;
}
.wiz-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    border-radius: 50%;
    background: #dde1e7;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    margin: 0 auto 6px;
    transition: background 0.25s, box-shadow 0.25s;
    border: 3px solid #f5f7fa;
    box-shadow: 0 0 0 0 transparent;
    line-height: 1;
}
.wiz-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #999;
    white-space: nowrap;
    transition: color 0.2s;
    line-height: 1.2;
}
/* Active step */
.wiz-step.active .wiz-num {
    background: #0066b8;
    box-shadow: 0 0 0 4px rgba(0,102,184,0.15);
}
.wiz-step.active .wiz-label { color: #0066b8; font-weight: 700; }
/* Done step */
.wiz-step.done { cursor: pointer; }
.wiz-step.done .wiz-num { background: #27ae60; }
.wiz-step.done .wiz-label { color: #666; }
.wiz-step.done:hover .wiz-num { box-shadow: 0 0 0 4px rgba(39,174,96,0.15); }
.wiz-step.active { cursor: default; }
.wiz-step:not(.active):not(.done):not(.skipped) { cursor: default; opacity: 0.4; }
.step-warn-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: #dc3545;
    border-radius: 50%;
    border: 2px solid #f5f7fa;
    animation: warnPulse 1.5s infinite;
}
@keyframes warnPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}
/* Skipped/empty visited steps — clickable but not green */
.wiz-step.skipped { cursor: pointer; }
.wiz-step.skipped .wiz-num { background: #ccd0d5; }
.wiz-step.skipped .wiz-label { color: #999; }
.wiz-step.skipped:hover .wiz-num { box-shadow: 0 0 0 4px rgba(0,0,0,0.06); }
/* Inactive */
.wiz-step:not(.active):not(.done) .wiz-num { background: #dde1e7; }
.wiz-step:not(.active):not(.done) .wiz-label { color: #aaa; }

/* Wizard navigation */
.wiz-nav {
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 10px;
}
.wiz-nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.btn-skip {
    background: none !important;
    color: #888 !important;
    border: none !important;
    box-shadow: none !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.btn-skip:hover {
    color: #0066b8 !important;
    background: none !important;
}
.btn-back {
    background: transparent !important;
    color: #666 !important;
    border: 1px solid #ccd0d5 !important;
    box-shadow: none !important;
    padding: 7px 16px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
}
.btn-back:hover {
    background: #f0f4f8 !important;
    color: #333 !important;
    border-color: #aaa !important;
}

/* Wizard card transition */
.wiz-card {
    transition: opacity 0.2s, transform 0.2s;
}
.wiz-card.wiz-hidden {
    display: none !important;
}

/* Option cards with previews */
.option-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin: 6px 0;
    border: 2px solid #e0e4ea;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.option-card:hover { background: #f8fafc; border-color: #ccd0d5; }
.option-card:has(> input:checked),
.option-card:has(> input:checked ~ .option-card-body) {
    border-color: #0066b8;
    background: #f0f7ff;
}
.option-card input[type="radio"],
.option-card input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
}
.option-card-body { flex: 1; min-width: 0; }
.option-card-body strong { display: block; margin-bottom: 2px; font-size: 14px; }

/* Preview boxes */
.preview-box {
    margin-top: 10px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.25s ease, margin 0.2s;
}
.option-card:has(> input:checked) .preview-box {
    max-height: 500px;
    opacity: 1;
}
.preview-inline {
    margin-top: 8px;
}
.option-card-check:has(input:checked) .preview-inline {
    max-height: 200px;
    opacity: 1;
}

/* Preview screen (mini mockup) */
.preview-screen {
    background: #f8fafc;
    border: 1px solid #e0e4ea;
    border-radius: 8px;
    padding: 14px;
    text-align: center;
    font-size: 12px;
    color: #555;
}
.preview-header {
    font-weight: 700;
    font-size: 13px;
    color: #333;
    margin-bottom: 10px;
}
.preview-icon {
    font-size: 28px;
    margin-bottom: 6px;
    line-height: 1;
}
.preview-icon-sm {
    font-size: 14px;
    display: inline;
}
.preview-text {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.4;
}
.preview-text-sm {
    font-size: 11px;
    color: #999;
    display: inline;
}
.preview-input {
    background: #fff;
    border: 1px solid #ccd0d5;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 12px;
    color: #888;
    margin: 6px auto;
    max-width: 200px;
    text-align: left;
}
.preview-btn {
    display: inline-block;
    background: #0066b8;
    color: #fff;
    padding: 5px 16px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 6px;
    cursor: default;
    position: relative;
}
.preview-btn:hover::after {
    content: attr(data-preview-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    color: #fff;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 5;
    pointer-events: none;
}
.preview-countdown {
    font-family: monospace;
    font-size: 13px;
    font-weight: 700;
    color: #888;
    margin-top: 8px;
    padding: 6px;
    background: #f0f0f0;
    border-radius: 4px;
}
.preview-countdown-active {
    color: #c0392b;
    background: #fff0f0;
}
.preview-after {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #ddd;
    font-size: 11px;
    color: #999;
}
.preview-pin {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 8px 0;
}
.pin-dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 34px;
    border: 1px solid #ccd0d5;
    border-radius: 4px;
    background: #fff;
    font-size: 18px;
    color: #333;
}

/* Mini form preview (visitor info) */
.preview-mini-form {
    background: #f8fafc;
    border: 1px solid #e0e4ea;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 12px;
}
.preview-label {
    font-weight: 600;
    font-size: 11px;
    color: #666;
    margin-bottom: 3px;
}
.preview-mini-form .preview-input {
    margin: 0;
    max-width: none;
    padding: 4px 8px;
    font-size: 11px;
}

/* Mini logs preview */
.preview-mini-logs {
    background: #f8fafc;
    border: 1px solid #e0e4ea;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 11px;
    color: #666;
    font-family: monospace;
    line-height: 1.6;
}

/* Mini puzzle preview */
.preview-puzzle {
    display: inline-grid;
    grid-template-columns: repeat(3, 24px);
    grid-template-rows: repeat(3, 24px);
    gap: 2px;
    background: #333;
    padding: 2px;
    border-radius: 3px;
}
.pp-tile {
    background: #e0e4ea;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #555;
    border-radius: 2px;
}
.pp-empty {
    background: #555;
}

/* Puzzle config / image gallery */
.puzzle-config {
    margin-top: 12px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e0e4ea;
    border-radius: 8px;
}
.puzzle-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}
.puzzle-thumb {
    position: relative;
    border: 3px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
    aspect-ratio: 1;
}
.puzzle-thumb:hover {
    border-color: #ccd0d5;
    transform: scale(1.04);
}
.puzzle-thumb.selected {
    border-color: #0066b8;
    box-shadow: 0 0 0 2px rgba(0,102,184,0.2);
}
.puzzle-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.puzzle-thumb-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 4px;
    text-align: center;
    line-height: 1.2;
}

/* Puzzle test modal (reuse admin modal styles) */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal-box {
    background: white;
    border-radius: 12px;
    padding: 20px 25px;
    max-width: 550px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e4ea;
    padding-bottom: 10px;
}
.modal-close {
    background: none !important;
    border: none !important;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0 5px !important;
    margin: 0 !important;
    box-shadow: none !important;
}
.modal-close-lg {
    background: #f0f0f0 !important;
    border: none !important;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #555;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    transition: background 0.15s;
}
.modal-close-lg:hover {
    background: #ddd !important;
    color: #222;
}

/* Success page */
.success-hero {
    text-align: center;
    padding: 24px 0 8px;
}
.success-icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 12px;
}
.success-hero h1 {
    font-size: 24px;
    margin-bottom: 6px;
}
.success-subtitle {
    font-size: 15px;
    color: #444;
    line-height: 1.5;
    max-width: 460px;
    margin: 0 auto;
}

/* "What to do next" guide on the success screen */
.next-steps-wrap {
    background: #eef6ff;
    border: 1px solid #cfe2f7;
    border-radius: 10px;
    padding: 14px 18px 14px 16px;
    margin: 0 0 16px;
}
.next-steps-title {
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #0066b8;
    margin-bottom: 8px;
}
.next-steps {
    margin: 0;
    padding-left: 22px;
    font-size: 14px;
    color: #333;
    line-height: 1.7;
}
.next-steps li { margin-bottom: 2px; }

/* Primary copy-link button under the share link box */
.success-copy-btn {
    margin-top: 14px;
    font-size: 16px;
}
.success-share-card {
    border: 2px solid #0066b8;
    background: #f0f7ff;
    padding: 24px;
}
.success-label {
    display: block;
    font-weight: 700;
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
}
.success-link-box {
    background: #fff;
    border: 2px solid #ccd0d5;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    position: relative;
}
.success-link-box:hover {
    border-color: #0066b8;
    box-shadow: 0 0 0 3px rgba(0,102,184,0.1);
}
.success-link-input {
    width: 100%;
    border: none !important;
    background: none !important;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 15px;
    font-weight: 600;
    color: #0066b8;
    padding: 0 !important;
    cursor: pointer;
    box-shadow: none !important;
    text-align: center;
}
.success-link-input:focus {
    outline: none;
    box-shadow: none !important;
}
.success-copy-hint {
    display: block;
    text-align: center;
    font-size: 12px;
    color: #888;
    margin-top: 6px;
}
.success-auth {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #d0dfef;
}
.success-auth-label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
}
.success-auth-value {
    background: #fff;
    border: 2px solid #ccd0d5;
    border-radius: 10px;
    padding: 14px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    text-align: center;
}
.success-auth-value:hover {
    border-color: #0066b8;
    box-shadow: 0 0 0 3px rgba(0,102,184,0.1);
}
.success-auth-input {
    border: none !important;
    background: none !important;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 3px;
    color: #1a1a2e;
    padding: 0 !important;
    cursor: pointer;
    text-align: center;
    width: 100%;
    box-shadow: none !important;
}
.success-auth-input:focus {
    outline: none;
    box-shadow: none !important;
}

/* PIN digit display */
.success-pin-display {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 16px 0 4px;
    cursor: pointer;
}
.pin-digit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 60px;
    background: #fff;
    border: 2px solid #ccd0d5;
    border-radius: 10px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 28px;
    font-weight: 800;
    color: #1a1a2e;
    transition: border-color 0.15s, transform 0.1s;
}
.success-pin-display:hover .pin-digit {
    border-color: #0066b8;
    transform: translateY(-2px);
}

/* Success details (mode/expiry info) */
.success-details {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #d0dfef;
    font-size: 13px;
    color: #555;
    line-height: 1.8;
}

/* Copyable instructions (interactive preview) */
.success-instructions-card {
    background: #f8fafc;
    border: 1px dashed #ccd0d5;
}
.success-instructions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    gap: 10px;
    flex-wrap: wrap;
}
.instr-btns {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.instr-preview {
    background: #fff;
    border: 1px solid #e0e4ea;
    border-radius: 8px;
    overflow: hidden;
}
.instr-line {
    padding: 10px 14px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.12s, color 0.12s, opacity 0.12s;
    position: relative;
    user-select: none;
    line-height: 1.5;
}
.instr-line:last-child { border-bottom: none; }
.instr-line:hover { background: #f8fafc; }
.instr-line.active::before {
    content: '\2713';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #27ae60;
    font-weight: 700;
    font-size: 14px;
}
.instr-line.excluded {
    background: #f5f5f5;
    color: #bbb;
    text-decoration: line-through;
    text-decoration-color: #ccc;
}
.instr-line.excluded::before {
    content: '';
}
.instr-line.excluded:hover {
    background: #f0f0f0;
    color: #999;
}

/* Monitor link (de-emphasized) */
.monitor-details {
    margin-top: 16px;
    border: 1px solid #e0e4ea;
    border-radius: 8px;
    overflow: hidden;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.monitor-details:hover,
.monitor-details[open] {
    opacity: 1;
}
.monitor-summary {
    font-size: 13px;
    font-weight: 500;
    color: #777;
    padding: 10px 14px;
    background: #f8f9fa;
    cursor: pointer;
}
.monitor-summary:hover {
    background: #f0f4f8;
}
.monitor-body {
    padding: 12px 14px;
}

/* Expiry quick-select chips */
.expiry-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}
.expiry-chip {
    padding: 6px 14px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    background: #f0f4f8 !important;
    color: #444 !important;
    border: 1px solid #dde1e7 !important;
    border-radius: 20px !important;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: none !important;
    margin: 0 !important;
}
.expiry-chip:hover {
    background: #e4eaf0 !important;
    border-color: #ccd0d5 !important;
}
.expiry-chip.active {
    background: #0066b8 !important;
    color: #fff !important;
    border-color: #0066b8 !important;
}
.expiry-preview {
    margin-top: 8px;
    font-size: 13px;
    color: #555;
    min-height: 20px;
}
.expiry-preview strong {
    color: #0066b8;
}

/* Custom date/time picker */
.dt-picker {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.dt-calendar {
    flex: 1;
    min-width: 240px;
    background: #fff;
    border: 1px solid #e0e4ea;
    border-radius: 10px;
    padding: 12px;
    user-select: none;
}
.dt-cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.dt-cal-title {
    font-weight: 700;
    font-size: 14px;
    color: #333;
}
.dt-cal-nav {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 16px !important;
    padding: 4px 10px !important;
    margin: 0 !important;
    color: #555 !important;
    cursor: pointer;
    border-radius: 6px !important;
    line-height: 1 !important;
}
.dt-cal-nav:hover { background: #f0f4f8 !important; }
.dt-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #999;
    margin-bottom: 4px;
}
.dt-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.dt-day {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0 auto;
    border-radius: 50%;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.12s;
    color: #333;
}
.dt-day:hover { background: #e8f0fe; }
.dt-day.selected {
    background: #0066b8;
    color: #fff;
    font-weight: 700;
}
.dt-day.today {
    border: 2px solid #0066b8;
}
.dt-day.disabled {
    color: #ccc;
    cursor: default;
    pointer-events: none;
}
.dt-day.other-month {
    color: #ccc;
}

/* Time spinner */
.dt-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding-top: 4px;
}
.dt-time-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
}
.dt-time-row {
    display: flex;
    align-items: center;
    gap: 4px;
}
.dt-colon {
    font-size: 20px;
    font-weight: 700;
    color: #555;
    padding: 0 2px;
}
.dt-spin {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.dt-spin-btn {
    background: #f0f4f8 !important;
    border: 1px solid #dde1e7 !important;
    box-shadow: none !important;
    color: #555 !important;
    font-size: 10px !important;
    padding: 4px 12px !important;
    margin: 0 !important;
    border-radius: 4px !important;
    cursor: pointer;
    line-height: 1 !important;
}
.dt-spin-btn:hover { background: #e4eaf0 !important; }
.dt-spin-val {
    width: 44px !important;
    text-align: center;
    font-size: 20px !important;
    font-weight: 700;
    padding: 6px 4px !important;
    border: 1px solid #dde1e7 !important;
    border-radius: 6px !important;
    background: #fff !important;
    color: #333;
}

/* Upload progress overlay */
.upload-progress-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}
.upload-progress-box {
    background: #fff;
    border-radius: 12px;
    padding: 30px 36px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.upload-progress-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 16px;
}
.upload-progress-bar-wrap {
    background: #e0e4ea;
    border-radius: 8px;
    height: 14px;
    overflow: hidden;
    margin-bottom: 10px;
}
.upload-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #0066b8, #2563eb);
    border-radius: 8px;
    transition: width 0.3s ease;
}
.upload-progress-pct {
    font-size: 28px;
    font-weight: 800;
    color: #0066b8;
    margin-bottom: 6px;
}
.upload-progress-stats {
    font-size: 12px;
    color: #888;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 480px) {
    body { padding: 0 12px 30px; }
    .card { padding: 16px; }
    .copy-row { flex-direction: column; }
    .file-item { flex-direction: column; align-items: flex-start; gap: 6px; }
    summary { flex-direction: column; align-items: flex-start; gap: 8px; }
    .download-right { margin-left: 0; }
    .upload-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .wiz-label { display: none; }
    .wizard-progress { gap: 2px; }
    .puzzle-gallery { grid-template-columns: repeat(3, 1fr); }
    .dt-picker { flex-direction: column; }
    .dt-calendar { min-width: 100%; }
}

/* Home-page call to action: switch to "receive documents" (reverse share).
   Styled as a self-contained banner so it never inherits the default/visited
   link color. */
.inbox-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 0 18px;
    padding: 12px 16px;
    background: #f0f7ff;
    border: 1px solid #cfe3f7;
    border-radius: 8px;
    color: #0a4b80;
    font-size: 14px;
    text-decoration: none;
    transition: background .15s, border-color .15s;
}
.inbox-cta:hover { background: #e3f2fd; border-color: #0066b8; }
.inbox-cta:visited { color: #0a4b80; }
.inbox-cta strong { color: #0a4b80; }
.inbox-cta .inbox-cta-icon { font-size: 18px; line-height: 1; }

/* Password field with a show/hide eye toggle */
.pw-reveal-wrap { position: relative; }
.pw-reveal-input { padding-right: 44px !important; }
.pw-reveal-btn {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}
.pw-reveal-btn:hover { opacity: 1; background: transparent; color: #0066b8; }

/* "Disable this document now" card on the content view (danger-tinted) */
.drop-disable-card { background: #fdf3f3; border: 1px solid #f1c0c0; }
.drop-disable-card h3 { color: #a93226; }
