/* ===== Fidoco Align Design System ===== */

/* Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* Global font override */
html, body {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
}

/* ===== CSS Variables ===== */
:root {
    --primary: #4F46E5;
    --primary-light: #6366F1;
    --primary-dark: #3730A3;
    --accent: #F59E0B;
    --accent-hover: #D97706;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-solid: rgba(255, 255, 255, 0.92);
    --surface-border: rgba(255, 255, 255, 0.8);
    --bg-secondary: #F9FAFB;
    --border: #E5E7EB;
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #9CA3AF;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

@keyframes pulse-ring {
    0%   { transform: scale(1); opacity: 0.4; }
    80%, 100% { transform: scale(1.3); opacity: 0; }
}

.anim-fade-in-up {
    animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.anim-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}

.anim-delay-1 { animation-delay: 0.1s; }
.anim-delay-2 { animation-delay: 0.2s; }
.anim-delay-3 { animation-delay: 0.3s; }
.anim-delay-4 { animation-delay: 0.4s; }
.anim-delay-5 { animation-delay: 0.5s; }
.anim-delay-6 { animation-delay: 0.6s; }
.anim-delay-7 { animation-delay: 0.7s; }

/* ===== Components ===== */

/* Glass card */
.glass {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--surface-border);
}

.glass-solid {
    background: var(--surface-solid);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.9);
}

/* Card hover lift */
.hover-lift {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.12);
}

/* Accent CTA button (amber) */
.btn-accent {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 36px;
    font-weight: 600;
    font-size: 1.0625rem;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    box-shadow: 0 4px 14px -2px rgba(245, 158, 11, 0.35);
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
    cursor: pointer;
    letter-spacing: -0.01em;
}
.btn-accent:hover {
    background: linear-gradient(135deg, #EAB308 0%, #B45309 100%);
    box-shadow: 0 8px 24px -4px rgba(245, 158, 11, 0.45);
    transform: translateY(-1px);
}

/* Secondary button (outline) */
.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 36px;
    font-weight: 600;
    font-size: 1.0625rem;
    border-radius: 14px;
    color: #374151;
    background: rgba(255, 255, 255, 0.8);
    border: 1.5px solid #D1D5DB;
    transition: all 0.2s ease;
    text-decoration: none;
    cursor: pointer;
    letter-spacing: -0.01em;
}
.btn-outline:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #9CA3AF;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* Primary button (indigo) */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    font-weight: 600;
    font-size: 1.0625rem;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, #4F46E5 0%, #4338CA 100%);
    box-shadow: 0 4px 14px -2px rgba(79, 70, 229, 0.4);
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    width: 100%;
    letter-spacing: -0.01em;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #4338CA 0%, #3730A3 100%);
    box-shadow: 0 8px 24px -4px rgba(79, 70, 229, 0.5);
    transform: translateY(-1px);
}
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #4F46E5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Trust badge pill */
.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: #374151;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Decorative background blob */
.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

/* Feature icon container */
.icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Pro card gradient border */
.pro-border {
    position: relative;
    border: 2px solid transparent;
    background:
        linear-gradient(white, white) padding-box,
        linear-gradient(135deg, #4F46E5, #7C3AED) border-box;
    border-radius: 16px;
}

/* Upload zone */
.upload-zone {
    border: 2px dashed #CBD5E1;
    border-radius: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 40px 24px;
    text-align: center;
}
.upload-zone:hover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.02);
}
.upload-zone.active {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.04);
    border-style: solid;
}

/* Progress bar shimmer */
.progress-shimmer {
    background: linear-gradient(90deg, #4F46E5, #7C3AED, #4F46E5);
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
    border-radius: 999px;
    height: 100%;
}

/* Glass header */
.glass-header {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* Check icon in pricing */
.check-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Page background */
.page-bg {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 30%, #EDE9FE 60%, #F5F3FF 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Input styling */
.input-styled {
    width: 100%;
    padding: 14px 18px;
    border: 1.5px solid #E5E7EB;
    border-radius: 12px;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    outline: none;
    background: white;
    font-family: inherit;
}
.input-styled:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.input-styled::placeholder {
    color: #9CA3AF;
}

/* Section divider */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(79, 70, 229, 0.12), transparent);
    margin: 0 auto;
    max-width: 200px;
}

/* Nav link */
.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6B7280;
    text-decoration: none;
    transition: color 0.15s ease;
    padding: 4px 0;
}
.nav-link:hover {
    color: var(--primary);
}
.nav-link-active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

/* Evidence Tooltips */
.evidence-tooltip-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
}
.evidence-icon {
    width: 16px;
    height: 16px;
    color: var(--primary);
    opacity: 0.6;
    cursor: help;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
}
.evidence-icon:hover {
    opacity: 1;
}
.evidence-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text-secondary);
    white-space: normal;
    width: max-content;
    max-width: 320px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 50;
    pointer-events: none;
}
.evidence-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--border);
}
.evidence-tooltip .evidence-label {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}
.evidence-tooltip-wrapper:hover .evidence-tooltip {
    display: block;
}

/* Before / After Rewrite Blocks */
.rewrite-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: border-color 0.15s ease;
}
.rewrite-block:hover {
    border-color: var(--primary);
}
.rewrite-block p {
    font-size: 0.9375rem;
    color: var(--text-primary);
    margin-bottom: 14px;
    line-height: 1.6;
}
.rewrite-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 640px) {
    .rewrite-comparison {
        grid-template-columns: 1fr;
    }
}
.rewrite-before,
.rewrite-after {
    padding: 14px;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.6;
}
.rewrite-before {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: var(--text-secondary);
}
.rewrite-after {
    background: rgba(34, 197, 94, 0.06);
    border: 1px solid rgba(34, 197, 94, 0.15);
    color: var(--text-primary);
}
.rewrite-label {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}
.rewrite-label-before {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}
.rewrite-label-after {
    background: rgba(34, 197, 94, 0.1);
    color: #22C55E;
}
.rewrite-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.rewrite-copy-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary);
}
.rewrite-copy-btn.copied {
    color: #22C55E;
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.2);
}

/* Privacy Badge */
.privacy-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    margin-top: 24px;
    font-size: 0.8125rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.privacy-badge svg {
    width: 16px;
    height: 16px;
    color: #22C55E;
    flex-shrink: 0;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 32px 16px;
    color: #9CA3AF;
    font-size: 0.8125rem;
}
.site-footer a {
    color: #9CA3AF;
    text-decoration: none;
    transition: color 0.15s ease;
}
.site-footer a:hover {
    color: #6B7280;
}

/* ===== Export Button ===== */
.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1.5px solid var(--primary);
    background: white;
    color: var(--primary);
}
.export-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}
.export-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== Saved Resumes List ===== */
.saved-resumes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.saved-resume-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1.5px solid #E5E7EB;
    background: white;
    transition: all 0.2s ease;
    cursor: default;
}
.saved-resume-item:hover {
    border-color: #C7D2FE;
    background: #FAFAFE;
}
.saved-resume-item.selected {
    border-color: var(--primary);
    background: #EEF2FF;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.saved-resume-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}
.saved-resume-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.saved-resume-date {
    font-size: 0.75rem;
    color: #9CA3AF;
}
.saved-resume-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
    flex-shrink: 0;
}
.saved-resume-select-btn {
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    border: 1.5px solid var(--primary);
    background: white;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.15s ease;
}
.saved-resume-select-btn:hover {
    background: var(--primary);
    color: white;
}
.saved-resume-item.selected .saved-resume-select-btn {
    background: var(--primary);
    color: white;
}
.saved-resume-delete-btn {
    padding: 6px;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    background: white;
    color: #9CA3AF;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.saved-resume-delete-btn:hover {
    border-color: #FCA5A5;
    color: #DC2626;
    background: #FEF2F2;
}

/* ===== Accessibility ===== */

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .anim-fade-in-up,
    .anim-fade-in {
        opacity: 1;
    }
    .hover-lift:hover {
        transform: none;
    }
    .progress-shimmer {
        animation: none;
    }
}

/* Keyboard focus ring — visible only with keyboard navigation */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Remove default outline for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 9999;
    padding: 12px 24px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 0 0 8px 8px;
    text-decoration: none;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 0;
}

/* ===== Mobile: History Card Layout ===== */
@media (max-width: 640px) {
    .history-table-wrapper table,
    .history-table-wrapper thead {
        display: none;
    }
    .history-cards-mobile {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    .history-card {
        background: white;
        border-radius: 12px;
        padding: 16px;
        border: 1px solid var(--border);
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    .history-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .history-card-date {
        font-size: 0.8125rem;
        color: var(--text-muted);
    }
    .history-card-score {
        font-size: 1.125rem;
        font-weight: 800;
    }
    .history-card-job {
        font-size: 0.875rem;
        color: var(--text-secondary);
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .history-card-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 8px;
        border-top: 1px solid var(--border);
    }
    .history-card-status {
        font-size: 0.75rem;
        font-weight: 600;
        padding: 2px 10px;
        border-radius: 999px;
    }
    .history-card-link {
        font-size: 0.8125rem;
        font-weight: 600;
        color: var(--primary);
        text-decoration: none;
    }
    .history-card-link:hover {
        text-decoration: underline;
    }
}
