/* ==========================================================================
   Piri-Piri's Signing Station - Modern Feline Design System
   ========================================================================== */

:root {
    /* Pastel Color Palette */
    --bg-primary: #f5f0eb;
    --bg-surface: rgba(255, 252, 248, 0.92);
    --bg-surface-elevated: rgba(255, 248, 242, 0.97);
    --bg-card: rgba(255, 250, 245, 0.85);
    --bg-glass-input: rgba(255, 245, 238, 0.8);
    
    /* Soft Pastel Feline Accent Palette */
    --accent-primary: #d97b6c;       /* Dusty rose-terracotta */
    --accent-secondary: #c9684d;     /* Muted sienna */
    --accent-glow: rgba(217, 123, 108, 0.15);
    --accent-gold: #c8975a;          /* Warm sand gold */
    --accent-paw: #fde8d8;           /* Soft paw peach */
    
    /* Supporting Status Colors */
    --success: #5ba08a;
    --success-bg: rgba(91, 160, 138, 0.12);
    --success-border: rgba(91, 160, 138, 0.3);
    --info: #6a9cbf;
    --error: #c97070;
    
    /* Typography Colors */
    --text-primary: #3b2e27;
    --text-secondary: #7a6358;
    --text-muted: #a89488;
    --border-subtle: rgba(100, 70, 50, 0.12);
    --border-accent: rgba(217, 123, 108, 0.35);
    
    /* Radii & Shadows */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --shadow-soft: 0 4px 20px -4px rgba(100, 70, 50, 0.12);
    --shadow-glow: 0 4px 16px -4px rgba(100, 70, 50, 0.1);
    --shadow-elevated: 0 8px 32px -8px rgba(100, 70, 50, 0.18);
    
    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Box Sizing */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(ellipse at 20% 10%, rgba(251, 213, 193, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(210, 195, 220, 0.3) 0%, transparent 50%);
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Ambient Background Lights — hidden in pastel theme */
.ambient-glow { display: none; }

/* App Wrapper */
.app-wrapper {
    position: relative;
    z-index: 1;
    max-width: 1080px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Header & Feline Branding
   ========================================================================== */

.app-header {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.75rem 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.app-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-gold), #c9a0c0);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.feline-profile {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.avatar-ring {
    position: relative;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, var(--accent-paw), var(--accent-primary));
    box-shadow: var(--shadow-soft);
    flex-shrink: 0;
}

.feline-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--accent-paw);
    display: block;
    border: 2px solid rgba(255,255,255,0.6);
}

.status-indicator-dot {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background-color: var(--success);
    border: 2.5px solid #fff;
    border-radius: 50%;
}

.badge-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.35rem;
    flex-wrap: wrap;
}

.authority-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(217, 123, 108, 0.12);
    color: var(--accent-secondary);
    border: 1px solid rgba(217, 123, 108, 0.25);
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.crypto-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(91, 160, 138, 0.12);
    color: #3d8f76;
    border: 1px solid rgba(91, 160, 138, 0.3);
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.status-pulse {
    width: 6px;
    height: 6px;
    background-color: var(--success);
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.main-title {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
}

.cert-card-pill {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition-smooth);
    color: var(--text-primary);
}

.cert-card-pill:hover {
    background: rgba(217, 123, 108, 0.1);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(100, 70, 50, 0.15);
}

.pill-icon {
    font-size: 1.3rem;
}

.pill-details {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.pill-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.pill-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-secondary);
}

.pill-arrow {
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.cert-card-pill:hover .pill-arrow {
    transform: translateX(3px);
    color: var(--accent-secondary);
}

/* ==========================================================================
   Main Cards Layout
   ========================================================================== */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.signing-card, .results-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    box-shadow: var(--shadow-soft);
    position: relative;
}

.section-block {
    margin-bottom: 2rem;
}

.section-block:last-of-type {
    margin-bottom: 1.5rem;
}

.block-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.15rem;
}

.step-num {
    width: 28px;
    height: 28px;
    background: var(--accent-primary);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.block-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ==========================================================================
   Dropzone Component
   ========================================================================== */

.dropzone-container {
    border: 2px dashed rgba(100, 70, 50, 0.2);
    background: var(--bg-glass-input);
    border-radius: var(--radius-md);
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.dropzone-container:hover, .dropzone-container.drag-over {
    border-color: var(--accent-primary);
    background: rgba(217, 123, 108, 0.06);
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}

.dropzone-container.drag-over {
    transform: scale(1.01);
}

.file-input-hidden {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.upload-icon-wrapper {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-icon-glow {
    display: none;
}

.upload-icon {
    font-size: 2.5rem;
    position: relative;
    z-index: 1;
    transition: var(--transition-smooth);
}

.floating-paw {
    position: absolute;
    right: -4px;
    bottom: -4px;
    font-size: 1.2rem;
    z-index: 2;
    animation: float-paw 3s ease-in-out infinite;
}

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

.dropzone-container:hover .upload-icon {
    transform: scale(1.12);
}

.dropzone-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.browse-link {
    color: var(--accent-secondary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.dropzone-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.security-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(200, 151, 90, 0.08);
    border: 1px solid var(--border-subtle);
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* Selected File Info Card */
.file-info-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: var(--bg-surface-elevated);
    border: 1px solid rgba(217, 123, 108, 0.35);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    text-align: left;
    box-shadow: 0 4px 20px rgba(100, 70, 50, 0.12);
}

.pdf-icon-badge {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #ffffff;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(217, 123, 108, 0.3);
}

.file-text-details {
    flex: 1;
    min-width: 0;
}

.selected-filename {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.file-meta-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.meta-tag {
    font-size: 0.78rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    background: rgba(100, 70, 50, 0.06);
    color: var(--text-muted);
}

.ready-tag {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.btn-remove-file {
    background: rgba(100, 70, 50, 0.08);
    border: none;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-file:hover {
    background: rgba(201, 112, 112, 0.15);
    color: var(--error);
}

/* ==========================================================================
   Options Grid & Inputs
   ========================================================================== */

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.option-group.full-width {
    grid-column: 1 / -1;
}

.option-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.preset-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.chip {
    background: rgba(200, 151, 90, 0.06);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.chip:hover {
    background: rgba(217, 123, 108, 0.1);
    color: var(--text-primary);
    border-color: rgba(217, 123, 108, 0.25);
}

.chip.active {
    background: rgba(217, 123, 108, 0.15);
    border-color: var(--accent-primary);
    color: var(--accent-secondary);
    font-weight: 600;
}

.custom-input {
    background: var(--bg-glass-input);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
    width: 100%;
}

.custom-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(217, 123, 108, 0.15);
    background: rgba(255, 248, 242, 0.95);
}

/* Placement Selector */
.placement-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
}

.placement-option {
    cursor: pointer;
}

.placement-option input[type="radio"] {
    display: none;
}

.placement-box {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-glass-input);
    border: 1px solid var(--border-subtle);
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.placement-option:hover .placement-box {
    border-color: rgba(217, 123, 108, 0.3);
    color: var(--text-primary);
}

.placement-option input[type="radio"]:checked + .placement-box {
    background: rgba(217, 123, 108, 0.12);
    border-color: var(--accent-primary);
    color: var(--accent-secondary);
    font-weight: 600;
}

/* Visual Micro-Page for Placement Preview */
.pos-preview {
    width: 18px;
    height: 24px;
    background: #f5ede6;
    border: 1px solid rgba(100, 70, 50, 0.25);
    border-radius: 2px;
    position: relative;
}

.pos-preview::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--accent-primary);
    border-radius: 1px;
}

.pos-preview.top-left::after { top: 2px; left: 2px; }
.pos-preview.top-right::after { top: 2px; right: 2px; }
.pos-preview.bottom-left::after { bottom: 2px; left: 2px; }
.pos-preview.bottom-right::after { bottom: 2px; right: 2px; }

/* ==========================================================================
   Action & Signing Buttons
   ========================================================================== */

.action-block {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

.btn-sign-primary {
    width: 100%;
    max-width: 480px;
    margin: 0 auto 0.75rem;
    padding: 1.1rem 2rem;
    background: var(--accent-primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.btn-sign-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    background: var(--accent-secondary);
    box-shadow: var(--shadow-elevated);
}

.btn-sign-primary:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-sign-primary:disabled {
    background: rgba(168, 148, 136, 0.35);
    color: rgba(122, 99, 88, 0.6);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-paw {
    font-size: 1.3rem;
}

.btn-loader {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.action-caption {
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* ==========================================================================
   Results & Preview Section
   ========================================================================== */

.results-card {
    animation: fade-slide-up 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.success-banner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: rgba(91, 160, 138, 0.1);
    border: 1px solid var(--success-border);
    border-radius: var(--radius-md);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.75rem;
}

.success-paw-stamp {
    width: 64px;
    height: 64px;
    object-fit: contain;
    animation: stamp-drop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes stamp-drop {
    0% { transform: scale(2.5) rotate(-15deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.success-tag {
    display: inline-block;
    color: var(--success);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.2rem;
}

.success-text h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.success-text p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.signature-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.75rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-item.full-row {
    grid-column: 1 / -1;
}

.detail-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.04em;
}

.detail-value {
    font-size: 0.92rem;
    color: var(--text-primary);
    font-weight: 500;
}

.detail-value.highlight {
    color: var(--accent-secondary);
    font-weight: 700;
}

.font-mono {
    font-family: 'Fira Code', monospace;
    font-size: 0.82rem;
}

.hash-box {
    word-break: break-all;
    background: rgba(100, 70, 50, 0.06);
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    color: var(--info);
}

.results-action-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.btn-download-primary {
    flex: 1;
    min-width: 240px;
    padding: 1rem 1.75rem;
    background: var(--success);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.btn-download-primary:hover {
    transform: translateY(-1px);
    filter: brightness(0.93);
    box-shadow: var(--shadow-elevated);
}

.btn-secondary {
    padding: 1rem 1.5rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-secondary:hover {
    background: rgba(217, 123, 108, 0.08);
    border-color: rgba(217, 123, 108, 0.3);
}

/* In-Browser PDF Preview */
.preview-container {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-surface-elevated);
    overflow: hidden;
}

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

.preview-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.preview-badge {
    background: rgba(217, 123, 108, 0.12);
    color: var(--accent-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
}

.preview-frame-wrapper {
    width: 100%;
    height: 520px;
    background: var(--bg-card);
}

.preview-frame-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ==========================================================================
   Certificate Modal Dialog
   ========================================================================== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(90, 60, 40, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fade-in 0.2s ease-out;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 620px;
    box-shadow: var(--shadow-elevated);
    overflow: hidden;
    animation: modal-pop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-pop {
    from { transform: scale(0.95) translateY(10px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

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

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.cert-icon-seal {
    font-size: 1.75rem;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.btn-close-modal:hover {
    color: var(--accent-secondary);
    background: rgba(217, 123, 108, 0.1);
}

.modal-body {
    padding: 1.75rem;
    max-height: 65vh;
    overflow-y: auto;
}

.cert-status-callout {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    background: rgba(217, 123, 108, 0.08);
    border: 1px solid rgba(217, 123, 108, 0.2);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
}

.callout-icon {
    font-size: 1.2rem;
}

.cert-status-callout strong {
    color: var(--accent-secondary);
    display: block;
    margin-bottom: 0.1rem;
}

.cert-status-callout p {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.cert-fields-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.cert-field-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border-subtle);
    gap: 1rem;
}

.cert-field-row.full {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
}

.field-title {
    font-size: 0.82rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.field-data {
    font-size: 0.88rem;
    color: var(--text-primary);
    text-align: right;
    word-break: break-all;
}

.font-bold {
    font-weight: 700;
    color: var(--accent-secondary);
}

.fingerprint-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: rgba(100, 70, 50, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.85rem;
    gap: 0.75rem;
}

.fingerprint-text {
    font-size: 0.76rem;
    color: var(--info);
    word-break: break-all;
    line-height: 1.4;
}

.btn-copy-fp {
    background: rgba(200, 151, 90, 0.08);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.btn-copy-fp:hover {
    background: var(--accent-primary);
    color: #ffffff;
}

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

.btn-download-cert {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--accent-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition-fast);
}

.btn-download-cert:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

.btn-modal-done {
    padding: 0.6rem 1.4rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-modal-done:hover {
    background: rgba(217, 123, 108, 0.1);
    border-color: rgba(217, 123, 108, 0.3);
}

/* ==========================================================================
   Toasts & Footer
   ========================================================================== */

.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    box-shadow: var(--shadow-elevated);
    animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toast-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.toast-success { border-color: rgba(16, 185, 129, 0.5); }
.toast.toast-error { border-color: rgba(239, 68, 68, 0.5); }

.app-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.footer-brand {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.footer-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 768px) {
    .app-wrapper {
        padding: 1.25rem 1rem;
    }

    .app-header {
        padding: 1.25rem;
    }

    .header-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-title {
        font-size: 1.5rem;
    }

    .signing-card, .results-card {
        padding: 1.5rem;
    }

    .results-action-row {
        flex-direction: column;
    }

    .btn-download-primary, .btn-secondary {
        width: 100%;
    }

    .preview-container {
        display: none;
    }

    .preview-frame-wrapper {
        height: 380px;
    }
}
