/* Docusign Premium Styles (V8 - Complete Restoration) */

:root {
    --ds-black: #1e1e1e;
    --ds-blue: #8A1538;
    /* Official QNB Burgundy */
    --ds-blue-dark: #5e0e26;
    --ds-gold: #C0A062;
    --ds-gold-hover: #eebb10;
    --ds-bg: #f5f5f5;
    --ds-text: #092A5C;
    /* Deep Navy for premium feel */
    --ds-text-light: #666666;
    --ds-border: #e0e0e0;
    --ds-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--ds-bg);
    color: var(--ds-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Urgency Timer (V8) --- */
.urgency-bar {
    background-color: #b00020;
    color: white;
    text-align: center;
    padding: 8px;
    font-size: 13px;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 2000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* --- Blurred Background (V8) --- */
.blurred-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: #e9eef2;
    background-image:
        linear-gradient(#d1d5db 1px, transparent 1px),
        linear-gradient(90deg, #d1d5db 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.3;
}

/* Header */
.ds-header {
    background: white;
    border-bottom: 1px solid #ccc;
    padding: 0;
    height: 64px;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    /* Adjust if timer is present, handled by JS or simple stacking */
    z-index: 100;
}

.header-container {
    width: 100%;
    max-width: 100%;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ds-logo svg {
    height: 32px;
    width: auto;
}

.secure-badge {
    font-size: 10px;
    background: #f0f4f8;
    color: #555;
    padding: 3px 6px;
    border-radius: 2px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid #ddd;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 1px solid #eee;
    padding-left: 16px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: #6c757d;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    font-size: 13px;
}

.user-info-header {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}

.header-email {
    font-size: 12px;
    font-weight: 600;
    color: var(--ds-black);
}

.status-text {
    font-size: 10px;
    color: #28a745;
    font-weight: 500;
}

/* Main Content Layout */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Centers content vertically */
    width: 100%;
    padding: 40px 20px;
}

/* Auth Box (Loading Screen) */
.auth-box {
    background: white;
    padding: 48px;
    border-radius: 2px;
    box-shadow: var(--ds-shadow);
    max-width: 400px;
    width: 100%;
    text-align: center;
    margin-top: 20px;
}

.auth-box h2 {
    margin-top: 24px;
    font-size: 18px;
    color: var(--ds-black);
    font-weight: 600;
}

.auth-box h3 {
    margin-top: 16px;
    font-size: 16px;
    color: var(--ds-black);
    font-weight: 600;
}

.auth-box p {
    color: var(--ds-text-light);
    font-size: 13px;
    margin-top: 8px;
}

.ds-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--ds-blue);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}

/* Doc Container */
.doc-container {
    width: 100%;
    max-width: 800px;
}

/* Alert Banner */
.alert-banner {
    background: #fff;
    border-left: 4px solid var(--ds-gold);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 16px 20px;
    border-radius: 2px;
    font-size: 14px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-banner .icon {
    font-size: 18px;
}

/* Doc Card */
.doc-card {
    background: white;
    border-radius: 2px;
    box-shadow: var(--ds-shadow);
    overflow: hidden;
    position: relative;
}

.doc-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--ds-blue);
}

.card-header {
    background: white;
    padding: 32px 40px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.doc-title-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.file-info h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--ds-black);
    margin-bottom: 6px;
    letter-spacing: -0.2px;
}

.meta {
    font-size: 12px;
    color: var(--ds-text-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.secure-lock {
    color: #155724;
    font-weight: 500;
    background: #d4edda;
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 11px;
}

.card-body {
    padding: 32px 40px 40px;
}

/* Personalization Box */
.personalization-box {
    background: #f9fafb;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 32px;
    border: 1px solid #eee;
}

.p-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
    line-height: 1.6;
}

.p-row:last-child {
    margin-bottom: 0;
}

.p-label {
    color: #555;
    font-weight: 500;
}

.p-value {
    font-weight: 600;
    color: var(--ds-black);
}

.status-pending {
    color: #b00020;
    background: #fce4ec;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* Message Box */
.message-box {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid #eee;
}

.sender-avatar {
    width: 48px;
    height: 48px;
    background: #e0e0e0;
    color: #555;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.message-content {
    font-size: 14px;
    color: var(--ds-text);
    padding-top: 4px;
}

.message-content strong {
    font-weight: 600;
    color: var(--ds-black);
}

.message-content p {
    margin-top: 8px;
    font-style: italic;
    color: #555;
    background: #fff;
    padding: 10px;
    border-left: 3px solid #ddd;
}

/* Action Area */
.action-area {
    margin-top: 20px;
}

.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
    font-size: 13px;
    color: var(--ds-text);
}

.checkbox-wrapper input {
    margin-top: 3px;
}

.btn-primary {
    background-color: var(--ds-gold);
    color: var(--ds-black);
    border: none;
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background-color: var(--ds-gold-hover);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Footer */
.trust-footer {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 24px;
    font-size: 11px;
    color: #888;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-links {
    margin-top: 24px;
    text-align: center;
    font-size: 11px;
    color: #999;
    padding-bottom: 40px;
}

.footer-links a {
    color: #999;
    text-decoration: none;
    margin: 0 8px;
}

.footer-links a:hover {
    text-decoration: underline;
    color: #666;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-box {
    text-align: center;
}

.ds-spinner-large {
    width: 64px;
    height: 64px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--ds-blue);
    border-radius: 50%;
    margin: 0 auto 24px;
    animation: spin 0.8s linear infinite;
}

.loader-box h3 {
    font-size: 20px;
    color: var(--ds-black);
    margin-bottom: 8px;
    font-weight: 600;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* --- Gatekeeper (Cloak) --- */
.gatekeeper-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f9f9f9;
    z-index: 9000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gk-box {
    background: white;
    padding: 40px 50px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    text-align: left;
}

.gk-logo {
    margin-bottom: 24px;
}

.gk-box h1 {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 30px;
}

.gk-input-group {
    margin-bottom: 20px;
}

.gk-input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}

.gk-input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.gk-btn {
    width: 100%;
    background: #ffc820;
    color: #333;
    font-weight: 700;
    border: none;
    padding: 14px;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 20px;
}

.gk-btn:hover {
    background: #eebb10;
}

.gk-links {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.gk-links a {
    color: #2463d1;
    text-decoration: none;
    font-weight: 600;
}

.gk-footer {
    margin-top: 40px;
    font-size: 12px;
    color: #999;
}

/* --- Legal Theme Overrides (V7) --- */
.badge-confidential {
    background-color: #b00020;
    color: white;
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.legal-alert {
    border-left-color: #b00020;
    background-color: #fff5f5;
    color: #b00020;
}

.legal-message {
    background-color: #fcfcfc;
    padding: 20px;
    border: 1px solid #eee;
}

.legal-avatar {
    background-color: #2c3e50;
    color: white;
}

.legal-quote {
    font-family: 'Georgia', serif;
    font-style: italic;
    color: #444;
    border-left: 3px solid #b00020 !important;
    background-color: #fff !important;
}

.legal-footer {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

/* --- ENHANCEMENT 1: Visual Proof (Blurred Document Background) --- */
.blurred-bg {
    /* Override previous simple blur */
    background: #f4f4f4;
    opacity: 1;
    z-index: -1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 50px;
    overflow: hidden;
}

.doc-preview-bg {
    width: 800px;
    height: 1000px;
    background: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    filter: blur(4px);
    /* The key blur effect */
    padding: 40px;
    position: relative;
    transform: scale(0.95);
    opacity: 0.6;
}

.doc-preview-header {
    height: 60px;
    border-bottom: 2px solid #eee;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.doc-preview-logo {
    width: 100px;
    height: 20px;
    background: #ddd;
}

.doc-preview-lines {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.doc-line {
    height: 12px;
    background: #eee;
    width: 100%;
}

.doc-line.short {
    width: 40%;
}

.doc-line.medium {
    width: 70%;
}

/* --- ENHANCEMENT 2: Fake Chat Widget --- */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    z-index: 5000;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    transform: translateY(120%);
    /* Hidden initially */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-widget.visible {
    transform: translateY(0);
}

.chat-header {
    background: var(--ds-blue);
    /* QNB Burgundy */
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-avatar {
    width: 35px;
    height: 35px;
    background: white;
    border-radius: 50%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
}

.chat-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: #2ecc71;
    border: 2px solid white;
    border-radius: 50%;
}

.chat-info h4 {
    font-size: 14px;
    margin: 0;
    font-weight: 600;
}

.chat-info span {
    font-size: 11px;
    opacity: 0.9;
}

.chat-body {
    padding: 15px;
    background: #f9f9f9;
    height: 200px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message {
    background: white;
    padding: 10px 12px;
    border-radius: 12px;
    border-top-left-radius: 2px;
    font-size: 13px;
    color: #333;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    line-height: 1.4;
    max-width: 90%;
    opacity: 0;
    transform: translateX(-10px);
    animation: slideIn 0.3s forwards;
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.chat-input-area {
    padding: 10px;
    border-top: 1px solid #eee;
    background: white;
}

.chat-input-placeholder {
    width: 100%;
    height: 35px;
    background: #f0f0f0;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 12px;
    color: #999;
    display: flex;
    align-items: center;
}

/* --- ENHANCEMENT 3: Execution Guide (Instruction Modal) --- */
.instruction-modal {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 340px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 6000;
    padding: 20px;
    border-left: 5px solid var(--ds-gold);
    /* QNB Gold */
    display: none;
    /* Hidden by default */
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.inst-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.inst-title {
    font-weight: 700;
    font-size: 16px;
    color: var(--ds-black);
}

.inst-close {
    cursor: pointer;
    color: #999;
    font-size: 18px;
}

.inst-step {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: center;
}

.step-num {
    background: var(--ds-blue);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

.step-text {
    font-size: 13px;
    color: #444;
    line-height: 1.3;
}

.arrow-bounce {
    position: absolute;
    top: -40px;
    right: 20px;
    font-size: 40px;
    color: var(--ds-gold);
    animation: bounce 1s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}