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

/* ==========================================================================
   ALAGEUM ELECTRIC MODERN LIGHT DESIGN SYSTEM
   ========================================================================== */
:root {
    /* Alageum Brand Identity (Pantone 186 CV) */
    --alageum-red: #C8102E;
    --alageum-red-hover: #AF0C26;
    --alageum-red-light: #E01A38;
    --alageum-red-tint: #FEF2F4;
    --alageum-red-border: #FCDADF;
    --alageum-red-glow: rgba(200, 16, 46, 0.22);

    /* Light Clean Surfaces */
    --bg-primary: #F4F6F9;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-subtle: #F8FAFC;
    --bg-inset: #F1F5F9;

    /* Borders */
    --border-color: #E2E8F0;
    --border-subtle: #E2E8F0;
    --border-card: #E5E9F0;
    --border-hover: #CBD5E1;
    --border-highlight: var(--alageum-red);

    /* Functional Accents */
    --primary: var(--alageum-red);
    --primary-hover: var(--alageum-red-hover);
    --primary-gradient: linear-gradient(135deg, #E01A38 0%, #C8102E 100%);
    --accent: #0284C7;

    --success: #10B981;
    --success-bg: #ECFDF5;
    --success-border: #A7F3D0;
    --success-text: #065F46;

    --warning: #F59E0B;
    --warning-bg: #FFFBEB;
    --warning-border: #FDE68A;
    --warning-text: #92400E;

    --danger: #EF4444;
    --danger-bg: #FEF2F2;
    --danger-border: #FECACA;
    --danger-text: #991B1B;

    /* Typography */
    --text-heading: #0F172A;
    --text-primary: #1E293B;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --text-light: #94A3B8;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
    --shadow-glow: 0 4px 16px rgba(200, 16, 46, 0.28);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    font-size: 13.5px;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.25rem 1.75rem;
    background: #ffffff;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    gap: 1.25rem;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-badge {
    background: var(--alageum-red);
    color: #ffffff;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(200, 16, 46, 0.3);
    flex-shrink: 0;
}

.logo-badge svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.alageum-brand-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(200, 16, 46, 0.28);
    user-select: none;
    text-decoration: none;
    transition: all 0.2s;
}

.alageum-brand-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(200, 16, 46, 0.35);
    opacity: 0.92;
}

.alageum-brand-badge img {
    height: 44px;
    width: auto;
    border-radius: 8px;
    display: block;
}

.alageum-emblem-svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.alageum-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
    text-align: left;
}

.alageum-brand-name {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-transform: lowercase;
}

.alageum-brand-sub {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: lowercase;
    opacity: 0.95;
    margin-top: 1px;
}

.header-text h1 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.01em;
}

.header-text p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 2px;
}

/* NCALayer Pill */
.ncalayer-pill {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 1rem;
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    border-radius: 9999px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--success-text);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.ncalayer-pill:hover {
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.status-dot.error {
    background: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
}

/* Tabs Navigation */
.tabs-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: #ffffff;
    padding: 0.4rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-card);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1.2rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-heading);
    background: var(--bg-subtle);
}

.tab-btn.active {
    background: var(--alageum-red-tint);
    color: var(--alageum-red);
    box-shadow: 0 1px 3px rgba(200, 16, 46, 0.08);
    font-weight: 700;
}

.tab-btn.active svg {
    color: var(--alageum-red);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cards */
.card {
    background: #ffffff;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-card);
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 0.4rem;
}

.card-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
    line-height: 1.5;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--border-color);
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    padding: 2.75rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 1.25rem;
}

.upload-zone:hover {
    border-color: var(--alageum-red);
    background: var(--alageum-red-tint);
}

.upload-icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 0.85rem;
    color: var(--text-light);
    transition: all 0.2s;
}

.upload-zone:hover .upload-icon {
    color: var(--alageum-red);
    transform: translateY(-2px);
}

.upload-zone p {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 0.35rem;
}

.upload-zone span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* File Badge */
.file-info-badge {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    background: var(--bg-inset);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-heading);
}

/* Form Controls */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.88rem;
    transition: all 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: var(--alageum-red);
    box-shadow: 0 0 0 3px var(--alageum-red-glow);
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.85rem 1.5rem;
    background: var(--alageum-red);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(200, 16, 46, 0.25);
}

.btn-primary:hover:not(:disabled) {
    background: var(--alageum-red-hover);
    box-shadow: 0 4px 14px rgba(200, 16, 46, 0.35);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* Spinner */
.spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* Results Card */
.result-card {
    display: none;
    margin-top: 1.75rem;
    padding: 1.5rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    animation: fadeIn 0.3s ease;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.result-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
    border-radius: 9999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.info-item {
    background: #ffffff;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.info-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.info-value {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-heading);
    word-break: break-all;
}

/* Downloads Group */
.downloads-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.85rem;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-heading);
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-download:hover {
    border-color: var(--alageum-red);
    color: var(--alageum-red);
    background: var(--alageum-red-tint);
    transform: translateY(-1px);
}

/* Secondary Button */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-heading);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Sub-nav Buttons */
.btn-subnav {
    background: transparent;
    border: none;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.btn-subnav.active {
    color: var(--alageum-red);
    background: var(--alageum-red-tint);
}

/* Signer Input Row */
.signer-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-remove-signer {
    background: var(--rose-bg);
    color: var(--rose-text);
    border: 1px solid var(--rose-border);
    border-radius: var(--radius-sm);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: all 0.15s;
}

.btn-remove-signer:hover {
    background: #FEE2E2;
}

/* Verification Result Banner */
.verify-banner {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
}

.verify-banner.success {
    background: var(--emerald-bg);
    border: 1px solid var(--emerald-border);
    color: var(--emerald-text);
}

.verify-banner.danger {
    background: var(--rose-bg);
    border: 1px solid var(--rose-border);
    color: var(--rose-text);
}

.verify-banner-icon {
    flex-shrink: 0;
}

.verify-banner-title {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.verify-banner-desc {
    font-size: 0.85rem;
    line-height: 1.45;
}

/* Routes Cards */
.route-item-card {
    background: #ffffff;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.route-item-card:hover {
    border-color: var(--alageum-red);
    box-shadow: var(--shadow-card);
    transform: translateY(-1px);
}

.route-item-card h4 {
    color: var(--text-heading) !important;
}

/* Signer Card in Detail */
.signer-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.signer-card.signed {
    background: var(--bg-subtle);
    border-color: #CBD5E1;
}

.signer-role {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.signer-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-top: 2px;
}

.signer-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-success {
    background: var(--emerald-bg);
    color: var(--emerald-text);
    border: 1px solid var(--emerald-border);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid var(--warning-border);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid var(--danger-border);
}


