/* ==========================================================================
   FASTCOPY — MASTER APPLICATION STYLES
   A precision-engineered, tactile clipboard and snippet manager.
   Strict rules: Space Grotesk (headings), IBM Plex Sans (body/UI), 
   JetBrains Mono (code/counters/timers), Phosphor Icons throughout.
   Cohesive Obsidian Slate + Industrial Amber palette.
   ========================================================================== */

:root {
    /* Obsidian Slate Canvas & Surfaces */
    --canvas: #0b0d11;
    --surface-1: #12151c;
    --surface-2: #181d26;
    --surface-3: #202734;
    --surface-hover: #262e3d;
    --surface-active: #2e3849;

    /* Hairline & Diffused Borders */
    --border-subtle: #242c3b;
    --border-hover: #374359;
    --border-focus: #f59e0b;
    --border-wash: rgba(245, 158, 11, 0.25);

    /* Text & Foregrounds */
    --text-primary: #f3f5f8;
    --text-secondary: #939fb2;
    --text-muted: #606d82;
    --text-inverted: #0b0d11;

    /* Industrial Safety Amber Accent */
    --amber: #f59e0b;
    --amber-hover: #fbb73d;
    --amber-dark: #d97706;
    --amber-depth: #b45309;
    --amber-wash: rgba(245, 158, 11, 0.12);
    --amber-border: rgba(245, 158, 11, 0.32);

    /* Status Colors */
    --success: #10b981;
    --success-wash: rgba(16, 185, 129, 0.12);
    --danger: #f43f5e;
    --danger-wash: rgba(244, 63, 94, 0.12);
    --info: #38bdf8;
    --info-wash: rgba(56, 189, 248, 0.12);

    /* Typography */
    --font-heading: 'Space Grotesk', -apple-system, sans-serif;
    --font-body: 'IBM Plex Sans', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Diffused Shadows */
    --shadow-soft: 0 4px 20px -2px rgba(0, 0, 0, 0.45);
    --shadow-elevated: 0 12px 36px -4px rgba(0, 0, 0, 0.65);
    --shadow-modal: 0 20px 48px -8px rgba(0, 0, 0, 0.8);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--canvas);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 clamp(0.75rem, 3.5vw, 1.5rem);
}

/* Utilities */
.hidden {
    display: none !important;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 13, 17, 0.95);
    border-bottom: 1px solid var(--border-subtle);
    backdrop-filter: blur(12px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
    gap: 1.5rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    flex-shrink: 0;
}

.logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--amber);
    color: #0b0d11;
    border-radius: 6px;
    box-shadow: 0 2px 0 var(--amber-depth);
    font-size: 18px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* User Profile Badge */
.profile-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.profile-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: 9999px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.profile-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--surface-3);
    color: var(--amber);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.profile-chip.anonymous {
    border-color: var(--amber-border);
    color: var(--amber);
    background: var(--amber-wash);
}

/* ==========================================================================
   BUTTONS (TACTILE, INDUSTRIAL DEPTH)
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.6rem 1.125rem;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.25;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    user-select: none;
    transition: all 0.12s ease;
    white-space: nowrap;
}

.btn-large {
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    border-radius: 8px;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: 6px;
}

.btn-primary {
    background: var(--amber);
    color: #0b0d11;
    border: 1px solid var(--amber-dark);
    box-shadow: 0 2px 0 var(--amber-depth), 0 3px 10px rgba(245, 158, 11, 0.22);
}

.btn-primary:hover {
    background: var(--amber-hover);
    transform: translateY(-1px);
    box-shadow: 0 3px 0 var(--amber-depth), 0 5px 14px rgba(245, 158, 11, 0.3);
}

.btn-primary:active {
    transform: translateY(2px);
    box-shadow: 0 0 0 var(--amber-depth), 0 1px 4px rgba(245, 158, 11, 0.15);
}

.btn-outline,
.btn-secondary {
    background: var(--surface-2);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 2px 0 #07090c, 0 2px 8px rgba(0, 0, 0, 0.3);
}

.btn-outline:hover,
.btn-secondary:hover {
    background: var(--surface-3);
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: 0 3px 0 #07090c, 0 4px 12px rgba(0, 0, 0, 0.4);
}

.btn-outline:active,
.btn-secondary:active {
    transform: translateY(2px);
    box-shadow: 0 0 0 #07090c;
}

.btn-danger {
    background: var(--danger-wash);
    color: var(--danger);
    border: 1px solid rgba(244, 63, 94, 0.35);
    box-shadow: 0 2px 0 rgba(244, 63, 94, 0.5);
}

.btn-danger:hover {
    background: rgba(244, 63, 94, 0.2);
    transform: translateY(-1px);
}

.btn-danger:active {
    transform: translateY(2px);
    box-shadow: none;
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    border-radius: 8px;
}

.btn-google {
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 0 #d1d5db;
    font-weight: 500;
}

.btn-google:hover {
    background: #f9fafb;
    transform: translateY(-1px);
    box-shadow: 0 3px 0 #d1d5db;
}

.btn-google:active {
    transform: translateY(2px);
    box-shadow: none;
}

.google-icon {
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   INPUTS & FORMS
   ========================================================================== */

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.45rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--amber);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.char-count {
    display: flex;
    justify-content: flex-end;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    font-variant-numeric: tabular-nums;
}

.form-info {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.form-info i {
    color: var(--amber);
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ==========================================================================
   PAGE 2 — SIGN IN / SIGN UP CARD
   ========================================================================== */

.auth-section {
    padding: 4.5rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-card {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: clamp(1.15rem, 5vw, 2.5rem);
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-elevated);
}

.auth-card-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-card-header .logo-badge {
    margin-bottom: 1rem;
}

.auth-card-header h2 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.auth-card-header p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.auth-tabs {
    display: flex;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 1.75rem;
}

.auth-tab {
    flex: 1;
    padding: 0.5rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.12s ease;
}

.auth-tab.active {
    background: var(--surface-3);
    color: var(--text-primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.auth-form button[type="submit"] {
    width: 100%;
    margin-top: 0.75rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-family: var(--font-mono);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-subtle);
}

.auth-divider span {
    padding: 0 0.75rem;
}

.auth-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-subtle);
}

.auth-link {
    color: var(--amber);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
}

.auth-link:hover {
    text-decoration: underline;
}

.btn-guest {
    width: 100%;
    border-style: dashed;
}

/* ==========================================================================
   PAGE 3 — DASHBOARD ("YOUR CLIPS")
   ========================================================================== */

.clips-section {
    padding: 2.5rem 0 5rem;
}

.clips-header {
    margin-bottom: 2rem;
}

.clips-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.clips-title-row h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.clips-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 260px;
    max-width: 520px;
}

.search-box input {
    padding-left: 2.5rem;
}

.search-box .search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.15rem;
    pointer-events: none;
}

.clips-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.clips-count-badge {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-muted);
    padding: 0.4rem 0.75rem;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    font-variant-numeric: tabular-nums;
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    background: var(--surface-1);
    border: 1px dashed var(--border-subtle);
    border-radius: 16px;
    max-width: 560px;
    margin: 2rem auto;
}

.empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: var(--surface-2);
    border-radius: 12px;
    color: var(--amber);
    font-size: 2rem;
    margin-bottom: 1.25rem;
}

.empty-state h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
    max-width: 40ch;
    margin-left: auto;
    margin-right: auto;
}

/* Clips Grid */
.clips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Repeating Clip Card */
.clip-card {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-soft);
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    overflow: hidden;
}

.clip-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-elevated);
}

.clip-card.favorite {
    border-color: var(--amber-border);
}

.clip-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border-subtle);
    gap: 0.75rem;
}

.clip-card-title-section {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    overflow: hidden;
}

.clip-card-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clip-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: fit-content;
}

.clip-badge-text {
    background: var(--surface-3);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.clip-badge-link {
    background: var(--info-wash);
    color: var(--info);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.clip-badge-file {
    background: var(--amber-wash);
    color: var(--amber);
    border: 1px solid var(--amber-wash-border);
}

.clip-card-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.clip-action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.12s ease;
}

.clip-action-btn:hover {
    color: var(--text-primary);
    background: var(--surface-3);
}

.clip-action-btn.favorite-active {
    color: var(--amber);
}

.clip-action-btn.delete-btn:hover {
    color: var(--danger);
    background: var(--danger-wash);
}

/* Content Preview */
.clip-card-content {
    padding: 1.25rem;
    flex: 1;
    position: relative;
    background: #0d1015;
}

.clip-card-text {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.6;
    color: #cbd5e1;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 140px;
    overflow: hidden;
    cursor: pointer;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.clip-card.is-expanded .clip-card-text,
.clip-card-text.expanded {
    max-height: 3000px;
}

.clip-card-text-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: linear-gradient(to bottom, transparent, #0d1015);
    pointer-events: none;
}

.clip-card.is-expanded .clip-card-text-fade {
    display: none !important;
}

.clip-card-expand-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.725rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.35rem 0.75rem;
    background: rgba(18, 21, 28, 0.85);
    border-top: 1px solid var(--border-subtle);
    transition: color 0.15s ease, background 0.15s ease;
}

.clip-card:hover .clip-card-expand-hint {
    color: var(--amber);
    background: var(--surface-2);
}

/* Clip Card Footer */
.clip-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: var(--surface-1);
    border-top: 1px solid var(--border-subtle);
    gap: 1rem;
}

.clip-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-family: var(--font-mono);
    font-size: 0.725rem;
    color: var(--text-muted);
}

.clip-card-date {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.clip-card-copy-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.clip-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    background: var(--amber);
    color: #0b0d11;
    border: 1px solid var(--amber-dark);
    box-shadow: 0 2px 0 var(--amber-depth);
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.12s ease;
}

.clip-copy-btn:hover {
    background: var(--amber-hover);
    transform: translateY(-1px);
}

.clip-copy-btn:active {
    transform: translateY(2px);
    box-shadow: none;
}

/* Floating Action Button */
.floating-add-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--amber);
    color: #0b0d11;
    border: 1px solid var(--amber-dark);
    box-shadow: 0 4px 0 var(--amber-depth), 0 8px 24px rgba(245, 158, 11, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    cursor: pointer;
    transition: all 0.15s ease;
    z-index: 90;
}

.floating-add-btn:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 6px 0 var(--amber-depth), 0 12px 30px rgba(245, 158, 11, 0.5);
}

.floating-add-btn:active {
    transform: translateY(3px) scale(0.98);
    box-shadow: 0 1px 0 var(--amber-depth);
}

/* ==========================================================================
   MODALS (CRISP, ELEVATED, DIFFUSED SHADOWS)
   ========================================================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(7, 9, 12, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    padding: 1.5rem;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    width: 100%;
    max-width: 580px;
    box-shadow: var(--shadow-modal);
    transform: translateY(8px);
    transition: transform 0.2s ease;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--surface-2);
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-header h3 i {
    color: var(--amber);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s ease;
}

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

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   PAGE 5 — QUICK PASTE & 1:1 4-DIGIT UNIQUE CODE
   ========================================================================== */

.paste-tabs {
    display: flex;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 1.25rem;
}

.paste-tab {
    flex: 1;
    padding: 0.5rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.12s ease;
}

.paste-tab.active {
    background: var(--surface-3);
    color: var(--text-primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Drag and Drop Zone */
.drop-zone {
    border: 2px dashed var(--border-subtle);
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: var(--surface-2);
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--amber);
    background: var(--amber-wash);
}

.drop-zone i {
    font-size: 2.5rem;
    color: var(--amber);
    margin-bottom: 0.75rem;
}

.drop-zone h4 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

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

/* 4-Digit Separated Digit Boxes */
.code-digit-boxes {
    display: flex;
    gap: clamp(5px, 2vw, 12px);
    justify-content: center;
    margin: 1.25rem 0;
}

.digit-box {
    width: clamp(40px, 13vw, 60px);
    height: clamp(50px, 16vw, 72px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: clamp(1.4rem, 6vw, 2rem);
    font-weight: 700;
    color: var(--amber);
    background: var(--surface-2);
    border: 2px solid var(--border-subtle);
    border-radius: 10px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4), 0 2px 0 #07090c;
    letter-spacing: normal;
}

.digit-box-input {
    text-align: center;
    padding: 0;
    caret-color: var(--amber);
}

.digit-box-input:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

/* QR Code & Share Display */
.code-result-panel {
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    margin-top: 1.25rem;
}

.qr-canvas-wrapper {
    background: #ffffff;
    padding: 12px;
    border-radius: 10px;
    display: inline-block;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    margin: 0.75rem 0;
}

.qr-canvas-wrapper canvas {
    display: block;
}

.share-link-row {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}

.share-link-row input {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    background: var(--surface-1);
}

.expiry-countdown-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.75rem;
    background: var(--surface-3);
    border: 1px solid var(--border-subtle);
    border-radius: 9999px;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--amber);
    margin-top: 0.5rem;
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   PAGE 6 — SHARE ACCESS MODAL (FROM EXISTING SAVED CLIP)
   ========================================================================== */

.share-tabs {
    display: flex;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 1.5rem;
}

.share-tab {
    flex: 1;
    padding: 0.5rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.12s ease;
}

.share-tab.active {
    background: var(--surface-3);
    color: var(--text-primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.share-status {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-size: 0.875rem;
    font-family: var(--font-mono);
}

.share-status.success {
    background: var(--success-wash);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.share-status.error {
    background: var(--danger-wash);
    color: var(--danger);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

/* ==========================================================================
   PAGE 7 — CONNECT DEVICE (SYNC)
   ========================================================================== */

.sync-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}

.sync-status .sync-spinner {
    animation: rotate 2s linear infinite;
    color: var(--amber);
}

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

/* ==========================================================================
   PAGE 8 — VIEW / RETRIEVE CLIP SCREEN
   ========================================================================== */

.view-clip-section {
    padding: 3.5rem 0 5rem;
    max-width: 820px;
    margin: 0 auto;
}

.resolved-clip-card {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    box-shadow: var(--shadow-elevated);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.resolved-clip-card.is-expandable {
    cursor: pointer;
}

.resolved-clip-card.is-expandable:hover {
    border-color: var(--amber-border);
    box-shadow: 0 8px 32px -4px rgba(245, 158, 11, 0.14);
}

.resolved-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.75rem;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    gap: 1rem;
}

.resolved-meta-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.resolved-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.resolved-meta-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.resolved-body {
    padding: 1.75rem;
    background: #0d1015;
    position: relative;
    overflow-x: auto;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Expandable / Collapsed state for Shared Clip */
.resolved-clip-card.is-collapsed .resolved-body {
    max-height: 190px;
    overflow: hidden;
}

.resolved-clip-card.is-expanded .resolved-body {
    max-height: 4500px;
    overflow: visible;
}

.resolved-fade-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 90px;
    background: linear-gradient(to bottom, rgba(13, 16, 21, 0), #0d1015 88%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 0.85rem;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.resolved-clip-card.is-expanded .resolved-fade-overlay {
    display: none !important;
}

.resolved-top-expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: var(--surface-3);
    border: 1px solid var(--border-subtle);
    color: var(--amber);
    cursor: pointer;
    font-size: 1.15rem;
    transition: all 0.15s ease;
    margin-left: 0.25rem;
}

.resolved-top-expand-btn:hover {
    background: var(--amber-wash);
    border-color: var(--amber-wash-border);
    transform: translateY(-1px);
}

.resolved-top-expand-btn.hidden {
    display: none !important;
}

#resolved-top-expand-icon {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.resolved-clip-card.is-expanded #resolved-top-expand-icon {
    transform: rotate(180deg);
}

.resolved-code {
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    line-height: 1.7;
    color: #e2e8f0;
    white-space: pre-wrap;
    word-break: break-word;
}

.resolved-link-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 1.25rem;
    gap: 1rem;
}

.resolved-file-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 1.25rem;
    gap: 1rem;
}

.resolved-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.75rem;
    background: var(--surface-1);
    border-top: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    gap: 1rem;
}

.resolved-footer-stats {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ==========================================================================
   PAGE 9 — EXPIRED / NOT FOUND STATE (CALM, REASSURING PRIVACY)
   ========================================================================== */

.expired-section {
    padding: 4.5rem 0;
    display: flex;
    justify-content: center;
}

.expired-card {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 3.5rem 2.5rem;
    max-width: 520px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-elevated);
}

.expired-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    color: var(--amber);
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
}

.expired-card h2 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.expired-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.expired-privacy-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.75rem;
    background: var(--amber-wash);
    border: 1px solid var(--amber-border);
    border-radius: 9999px;
    font-family: var(--font-mono);
    font-size: 0.785rem;
    color: var(--amber);
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */

.toast-container {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 10000;
    pointer-events: none;
}

.toast {
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    box-shadow: var(--shadow-elevated);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: auto;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    border-left: 3px solid var(--success);
}

.toast.error {
    border-left: 3px solid var(--danger);
}

.toast.warning {
    border-left: 3px solid var(--amber);
}

.toast-icon {
    font-size: 1.1rem;
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--amber); }

/* ==========================================================================
   LOADING OVERLAY
   ========================================================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--canvas);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 9999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--surface-3);
    border-top-color: var(--amber);
    border-radius: 50%;
    animation: rotate 0.8s linear infinite;
}

.loading-overlay p {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ==========================================================================
   RESPONSIVE DESIGN (LOW, MEDIUM, HIGH MOBILE TIERS)
   ui-ux-pro-max guidelines: 44px touch targets, >=8px gap, zero overflow
   ========================================================================== */

/* Low Devices (<= 374px) — iPhone SE 1st gen, compact Androids */
@media (max-width: 374px) {
    .header-content {
        height: 52px;
        gap: 0.35rem;
    }

    .logo {
        font-size: 1.15rem;
        gap: 0.4rem;
    }

    .logo-badge {
        width: 26px;
        height: 26px;
        font-size: 15px;
    }

    .profile-chip {
        padding: 0.2rem 0.45rem;
        font-size: 0.72rem;
    }

    .auth-card {
        padding: 0.85rem 0.75rem;
        border-radius: 12px;
    }

    .auth-card-header {
        margin-bottom: 1.15rem;
    }

    .auth-card-header h2 {
        font-size: 1.35rem;
    }

    .auth-card-header p {
        font-size: 0.8rem;
    }

    .view-clip-section {
        padding: 1.5rem 0 3rem;
    }

    .resolved-header {
        padding: 0.85rem 0.75rem;
        gap: 0.5rem;
    }

    .resolved-meta-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .resolved-title {
        font-size: 1.15rem;
    }

    .resolved-meta-right {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .resolved-body {
        padding: 0.85rem 0.75rem;
    }

    .resolved-footer {
        padding: 0.85rem 0.75rem;
        gap: 0.65rem;
    }

    .resolved-footer .btn {
        width: 100%;
    }

    .modal-content {
        margin: 0.5rem;
        padding: 1rem 0.85rem;
    }
}

/* Medium Devices (375px – 480px) — Standard iPhones, Pixels, Galaxy Phones */
@media (min-width: 375px) and (max-width: 480px) {
    .header-content {
        height: 58px;
    }

    .auth-card {
        padding: 1.5rem 1.15rem;
    }

    .resolved-header {
        padding: 1.15rem 1.25rem;
    }

    .resolved-body {
        padding: 1.25rem;
    }
}

/* High Mobile & Phablets (481px – 767px) — Large Phones, Landscape, Foldables */
@media (min-width: 481px) and (max-width: 767px) {
    .auth-card {
        max-width: 440px;
        margin: 0 auto;
    }

    .clips-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* Global Mobile & Tablet (< 768px) */
@media (max-width: 768px) {
    .header-content {
        height: 60px;
    }

    .clips-title-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .clips-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: 100%;
    }

    .clips-stats {
        justify-content: space-between;
    }

    .clips-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }

    .resolved-header,
    .resolved-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Prevent iOS 16px font auto-zoom on inputs */
    input[type="text"],
    input[type="password"],
    input[type="email"],
    textarea,
    select {
        font-size: 16px;
    }

    /* Safe-area inset padding on mobile */
    body {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .site-footer {
        padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
    }
}

/* ==========================================================================
   POWERED BY PROMPTGALLERY INDIA & SHARED FOOTER
   ========================================================================== */

.site-footer {
    padding: 2.5rem 0 2rem;
    background: #08090c;
    border-top: 1px solid var(--border-subtle);
    margin-top: 4rem;
}

.footer-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    align-items: center;
    text-align: center;
}

.footer-powered-by {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78125rem;
    color: var(--text-muted);
}

.footer-powered-by a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.15s ease;
}

.footer-powered-by a:hover {
    color: var(--amber);
}

.footer-powered-by .pg-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--amber);
    display: inline-block;
}

.footer-tools-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    width: 100%;
    max-width: 820px;
}

.footer-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--text-muted);
}

.footer-tools-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem 1.25rem;
}

.footer-tool-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8125rem;
    transition: color 0.15s ease;
}

.footer-tool-link:hover {
    color: var(--amber);
}

.footer-nav-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem 1.5rem;
}

.footer-nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8125rem;
    transition: color 0.15s ease;
}

.footer-nav-link:hover {
    color: var(--text-primary);
}

.footer-copyright {
    font-family: var(--font-mono);
    font-size: 0.71875rem;
    color: var(--text-muted);
}