/* ==========================================================================
   ZeeSigner Online Web Signer — Modern Light Theme Design System
   Matches ZeeSigner (zeejb.com/zeesigner/) light palette & typography
   Zero emojis, pure Bootstrap Icons, ultra-responsive mobile
   ========================================================================== */

:root {
    --bg: #F8FAFC;
    --bg-subtle: #F1F5F9;
    --surface: #FFFFFF;
    --surface-hover: #F8FAFC;
    --card: #FFFFFF;
    --card-border: #E2E8F0;
    --border-focus: #CBD5E1;
    --text-main: #0F172A;
    --text-body: #334155;
    --text-muted: #64748B;
    --line: #E2E8F0;
    --brand: #FF6600;
    --brand-hover: #E65C00;
    --brand-gradient: linear-gradient(135deg, #FF6600 0%, #FD9E13 100%);
    --gold: #FF8A00;
    --orange: #FD9E13;
    --green: #10B981;
    --green-bg: #ECFDF5;
    --green-border: #A7F3D0;
    --green-text: #065F46;
    --amber-bg: #FFFBEB;
    --amber-border: #FDE68A;
    --amber-text: #92400E;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04);
    --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
    --shadow-modal: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg);
    background-image: 
        radial-gradient(circle at 12% 12%, rgba(253, 158, 19, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 88% 88%, rgba(16, 185, 129, 0.03) 0%, transparent 40%);
    color: var(--text-body);
    min-height: 100vh;
    padding-bottom: 60px;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 880px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* ==========================================================================
   Header
   ========================================================================== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 24px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.brand-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(255, 102, 0, 0.2);
}

.brand-title {
    font-family: 'Outfit', sans-serif;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.badge-version {
    font-size: 11px;
    font-weight: 700;
    color: var(--green-text);
    background: var(--green-bg);
    border: 1px solid var(--green-border);
    padding: 2px 8px;
    border-radius: 6px;
}

.nav-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-btn {
    color: var(--text-main);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    background: var(--surface);
    border: 1px solid var(--card-border);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
}

.nav-btn:hover {
    background: var(--bg-subtle);
    border-color: #CBD5E1;
}

/* ==========================================================================
   Tabs
   ========================================================================== */
.tabs-container {
    display: flex;
    background: var(--bg-subtle);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 24px;
    gap: 4px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 700;
    padding: 11px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    user-select: none;
}

.tab-btn.active {
    background: var(--surface);
    color: var(--text-main);
    border: 1px solid var(--card-border);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.tab-btn.active i {
    color: var(--brand);
}

/* ==========================================================================
   Card Container
   ========================================================================== */
.glass-card {
    background: var(--surface);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    padding: 32px 28px;
    box-shadow: var(--shadow-card);
    margin-bottom: 28px;
}

.card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.card-sub {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 22px;
}

/* Pre-cached IPA Banner */
.ipa-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--green-bg);
    border: 1px solid var(--green-border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 24px;
}

.ipa-icon {
    font-size: 22px;
    color: var(--green);
    flex-shrink: 0;
}

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

.ipa-name {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--green-text);
    margin-bottom: 2px;
}

.ipa-note {
    font-size: 12px;
    color: var(--green-text);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ==========================================================================
   Upload Dropzones
   ========================================================================== */
.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 22px;
}

@media (max-width: 640px) {
    .upload-grid { grid-template-columns: 1fr; }
}

.upload-zone {
    background: var(--bg);
    border: 2px dashed var(--card-border);
    border-radius: var(--radius-lg);
    padding: 24px 18px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    user-select: none;
}

.upload-zone:hover, .upload-zone.dragover {
    background: #FFFBEB;
    border-color: var(--brand);
}

.upload-zone.loaded {
    background: var(--green-bg);
    border-color: var(--green);
    border-style: solid;
}

.zone-icon {
    font-size: 26px;
    color: var(--brand);
    margin-bottom: 8px;
}

.upload-zone.loaded .zone-icon {
    color: var(--green);
}

.zone-label {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.zone-hint {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.4;
}

.zone-filename {
    font-size: 12px;
    font-weight: 700;
    color: var(--green-text);
    margin-top: 8px;
    word-break: break-all;
    display: none;
}

.p12-pass-wrap {
    margin-top: 14px;
    display: none;
    text-align: left;
}

.p12-pass-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-main);
    display: block;
    margin-bottom: 4px;
}

.p12-pass-input {
    width: 100%;
    background: #FFFFFF;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-main);
    font-size: 13px;
    outline: none;
}
.p12-pass-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.12);
}

/* ==========================================================================
   Main Action Button
   ========================================================================== */
.btn-sign {
    width: 100%;
    background: var(--brand-gradient);
    color: #000;
    font-size: 15px;
    font-weight: 800;
    padding: 16px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 18px rgba(255, 102, 0, 0.28);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    margin-bottom: 18px;
}

.btn-sign:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(255, 102, 0, 0.4);
}

.btn-sign:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Console Log Box */
.terminal-box {
    background: #0F172A;
    border: 1px solid #334155;
    border-radius: var(--radius-md);
    padding: 14px 16px;
    font-family: ui-monospace, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #38BDF8;
    max-height: 180px;
    overflow-y: auto;
    display: none;
    margin-bottom: 20px;
}

.log-line { margin-bottom: 2px; }
.log-line.success { color: #34D399; }
.log-line.warn { color: #FBBF24; }
.log-line.error { color: #F87171; }

/* Success Install Box */
.install-success-box {
    display: none;
    background: var(--green-bg);
    border: 1px solid var(--green-border);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    text-align: center;
    margin-bottom: 24px;
    animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.is-icon { margin-bottom: 10px; }
.is-title { font-family: 'Outfit', sans-serif; font-size: 21px; font-weight: 800; color: var(--green-text); margin-bottom: 6px; }
.is-sub { font-size: 13px; color: var(--green-text); margin-bottom: 16px; }

.btn-relaunch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--brand-gradient);
    color: #000;
    font-weight: 800;
    font-size: 13.5px;
    padding: 12px 22px;
    border-radius: var(--radius-md);
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(255, 102, 0, 0.25);
}

/* ==========================================================================
   Upsell Developer Certificates Section
   ========================================================================== */
.upsell-section {
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.upsell-header {
    text-align: center;
    margin-bottom: 20px;
}

.upsell-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--amber-bg);
    border: 1px solid var(--amber-border);
    color: #B45309;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 3px 12px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.upsell-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 6px;
}

.upsell-header p {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 540px;
    margin: 0 auto;
    line-height: 1.5;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .plans-grid { grid-template-columns: 1fr; }
}

.plan-card {
    background: var(--bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.2s;
}

.plan-card:hover {
    background: var(--surface);
    border-color: #CBD5E1;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.plan-card.popular {
    border-color: var(--brand);
    background: #FFFBEB;
    box-shadow: 0 4px 16px rgba(255, 102, 0, 0.1);
}

.plan-tag {
    position: absolute;
    top: -8px;
    left: 14px;
    background: var(--brand-gradient);
    color: #000;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 999px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.plan-name { font-size: 15px; font-weight: 800; color: var(--text-main); margin-bottom: 3px; }
.plan-sub { font-size: 11.5px; color: var(--text-muted); min-height: 30px; }

.plan-price-row {
    margin: 14px 0;
    display: flex;
    align-items: baseline;
    gap: 4px;
}
.plan-price { font-family: 'Outfit', sans-serif; font-size: 26px; font-weight: 900; color: var(--brand); }
.plan-period { font-size: 12px; color: var(--text-muted); }

.plan-features {
    list-style: none;
    font-size: 12px;
    color: var(--text-body);
    margin-bottom: 18px;
    flex: 1;
}
.plan-features li {
    margin-bottom: 7px;
    display: flex;
    align-items: center;
    line-height: 1.4;
}

.btn-plan-buy {
    background: var(--surface);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    font-size: 12.5px;
    font-weight: 700;
    padding: 10px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.plan-card.popular .btn-plan-buy {
    background: var(--brand-gradient);
    color: #000;
    border: none;
    font-weight: 800;
}
.btn-plan-buy:hover { opacity: 0.92; }

/* ==========================================================================
   Customer Portal Tab
   ========================================================================== */
.portal-search-row {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.portal-input {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    color: var(--text-main);
    font-size: 13.5px;
    outline: none;
    transition: all 0.2s;
}
.portal-input:focus {
    border-color: var(--brand);
    background: #FFF;
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.12);
}

.btn-portal-search {
    background: var(--brand-gradient);
    color: #000;
    border: none;
    font-size: 13.5px;
    font-weight: 800;
    padding: 0 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.25);
}

.portal-result-card {
    display: none;
    background: var(--surface);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 22px;
    margin-top: 18px;
    box-shadow: var(--shadow-sm);
}

.pr-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.pr-title { font-family: 'Outfit', sans-serif; font-size: 16px; font-weight: 800; color: var(--text-main); }
.pr-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.pr-badge.green {
    background: var(--green-bg);
    color: var(--green-text);
    border: 1px solid var(--green-border);
}
.pr-badge.orange {
    background: var(--amber-bg);
    color: #B45309;
    border: 1px solid var(--amber-border);
}

.pr-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
}

@media (max-width: 600px) {
    .pr-grid { grid-template-columns: 1fr; }
}

.pr-item {
    background: var(--bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}
.pr-label { font-size: 11px; color: var(--text-muted); display: block; margin-bottom: 2px; }
.pr-val { font-size: 12.5px; font-weight: 600; color: var(--text-main); word-break: break-all; }

.portal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-onetap-install {
    background: var(--brand-gradient);
    color: #000;
    font-weight: 800;
    font-size: 14px;
    padding: 14px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(255, 102, 0, 0.28);
}

.portal-download-row {
    display: flex;
    gap: 8px;
}
.portal-download-row a {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    font-size: 12px;
    font-weight: 700;
    padding: 10px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.portal-download-row a:hover { background: var(--bg-subtle); border-color: #CBD5E1; }

/* ==========================================================================
   Signing Progress Popup Modal
   ========================================================================== */
.sign-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeInModal 0.2s ease-out;
}

.sign-modal-backdrop.active {
    display: flex !important;
}

.sign-modal-card {
    background: #FFFFFF !important;
    border: 1px solid var(--card-border) !important;
    border-radius: var(--radius-xl) !important;
    padding: 32px 24px !important;
    max-width: 420px !important;
    width: 100% !important;
    text-align: center !important;
    box-shadow: var(--shadow-modal) !important;
}

.sp-icon-wrap {
    position: relative;
    width: 68px;
    height: 68px;
    margin: 0 auto 16px;
    background: var(--brand-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 28px;
    box-shadow: 0 4px 16px rgba(255, 102, 0, 0.28);
}

.sp-pulse-ring {
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    border: 2px solid var(--brand);
    animation: pulseRing 1.8s infinite;
}

@keyframes pulseRing {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 0.2; }
    100% { transform: scale(0.9); opacity: 0.8; }
}

.sp-title {
    font-family: 'Outfit', sans-serif;
    font-size: 21px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 4px;
}

.sp-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
    min-height: 20px;
}

.sp-progress-bar-wrap {
    width: 100%;
    height: 10px;
    background: var(--bg-subtle);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    margin-bottom: 10px;
}

.sp-progress-bar {
    height: 100%;
    background: var(--brand-gradient);
    border-radius: 999px;
    transition: width 0.35s ease;
}

.sp-percent-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13.5px;
    font-weight: 800;
    color: var(--brand);
    margin-bottom: 16px;
}

.sp-step-hint {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
}

.sp-note {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.4;
}

