/* GoSign — GLD Brand Styles */
:root {
    --brand-blue: #2941AB;
    --brand-blue-dark: #1e3189;
    --brand-blue-light: #e8ecf7;
    --brand-green: #27ae60;
    --brand-red: #e74c3c;
    --brand-orange: #f39c12;
    --text-primary: #1a1a2e;
    --text-secondary: #666;
    --border: #dee2e6;
    --bg-light: #f8f9fc;
    --white: #ffffff;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --radius: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', Arial, sans-serif; background: var(--bg-light); color: var(--text-primary); }

/* Navbar */
.navbar {
    background: var(--brand-blue);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.navbar-brand .logo {
    color: var(--white);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
}
.navbar-menu { display: flex; gap: 8px; align-items: center; }
.nav-link {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    transition: background 0.2s;
}
.nav-link:hover { background: rgba(255,255,255,0.15); color: var(--white); }

/* Layout */
#main-content { padding: 32px; max-width: 1200px; margin: 0 auto; }

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.card-header h2 { font-size: 20px; font-weight: 600; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-primary { background: var(--brand-blue); color: var(--white); }
.btn-primary:hover { background: var(--brand-blue-dark); }
.btn-success { background: var(--brand-green); color: var(--white); }
.btn-success:hover { background: #219a52; }
.btn-danger { background: var(--brand-red); color: var(--white); }
.btn-danger:hover { background: #c0392b; }
.btn-outline {
    background: transparent;
    border: 2px solid var(--brand-blue);
    color: var(--brand-blue);
}
.btn-outline:hover { background: var(--brand-blue-light); }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* Stat cards */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
}
.stat-card .stat-number { font-size: 36px; font-weight: 700; color: var(--brand-blue); }
.stat-card .stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--bg-light); font-weight: 600; font-size: 13px; color: var(--text-secondary); }
tr:hover td { background: var(--brand-blue-light); }

/* Status badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-draft { background: #f0f0f0; color: var(--text-secondary); }
.badge-sent { background: #e3f2fd; color: #1565c0; }
.badge-completed { background: #e8f5e9; color: #2e7d32; }
.badge-declined { background: #ffebee; color: #c62828; }
.badge-expired { background: #fff3e0; color: #e65100; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}
.form-control:focus { outline: none; border-color: var(--brand-blue); }

/* Upload zone */
.upload-zone {
    border: 3px dashed var(--border);
    border-radius: var(--radius);
    padding: 60px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--brand-blue);
    background: var(--brand-blue-light);
}
.upload-zone .upload-icon { font-size: 48px; margin-bottom: 16px; }
.upload-zone p { color: var(--text-secondary); font-size: 15px; }

/* PDF viewer + field editor */
.editor-layout { display: grid; grid-template-columns: 1fr 280px; gap: 24px; }
.pdf-canvas-wrap { position: relative; background: #555; border-radius: var(--radius); overflow: auto; }
#pdf-canvas { display: block; }
.field-block {
    position: absolute;
    border: 2px dashed var(--brand-blue);
    background: rgba(41, 65, 171, 0.08);
    border-radius: 4px;
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--brand-blue);
    text-transform: uppercase;
    user-select: none;
}
.field-block:hover { background: rgba(41, 65, 171, 0.15); }
.field-panel { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.field-type-btn {
    display: block;
    width: 100%;
    margin-bottom: 8px;
    padding: 10px;
    background: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    transition: all 0.2s;
}
.field-type-btn:hover { border-color: var(--brand-blue); background: var(--brand-blue-light); color: var(--brand-blue); }

/* Audit trail */
.audit-event {
    padding: 12px 16px;
    border-left: 3px solid var(--brand-blue);
    background: var(--bg-light);
    margin-bottom: 8px;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 13px;
}
.audit-event .event-time { color: var(--text-secondary); font-size: 11px; }
.audit-event .event-type { font-weight: 600; }

/* Sign document page */
.sign-layout { max-width: 900px; margin: 0 auto; }
.signature-pad-wrap {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    padding: 8px;
    margin-bottom: 16px;
}
#signature-canvas { display: block; cursor: crosshair; }
.otp-input {
    font-size: 32px;
    letter-spacing: 16px;
    text-align: center;
    font-weight: bold;
    width: 240px;
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-success { background: #e8f5e9; color: #2e7d32; border-left: 4px solid var(--brand-green); }
.alert-danger { background: #ffebee; color: #c62828; border-left: 4px solid var(--brand-red); }
.alert-info { background: var(--brand-blue-light); color: var(--brand-blue); border-left: 4px solid var(--brand-blue); }

/* Page transitions */
#main-content > div { animation: fadein 0.2s ease-in; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(41, 65, 171, 0.2);
    border-top-color: var(--brand-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-box {
    background: var(--white);
    border-radius: var(--radius);
    padding: 32px;
    min-width: 420px;
    max-width: 560px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.modal-box h3 { margin-bottom: 20px; font-size: 20px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

/* Responsive */
@media (max-width: 768px) {
    #main-content { padding: 16px; }
    .editor-layout { grid-template-columns: 1fr; }
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
}
