:root {
    --blue: #2563eb;
    --red: #dc2626;
    --card: rgba(255, 255, 255, 0.98);
    --border: #e2e8f0;
    --text-dark: #0f172a;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }

body {
    min-height: 100vh;
    background: #0f172a;
    display: flex; justify-content: center; align-items: center; padding: 20px;
}

.background-mesh {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.1) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(220, 38, 38, 0.1) 0%, transparent 40%);
    z-index: -1;
}

.form-card { width: 100%; max-width: 750px; background: var(--card); border-radius: 24px; padding: 40px; box-shadow: 0 40px 100px rgba(0,0,0,0.5); }

/* HEADER & LOGO HANDLING */
.header-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 30px; }
.logo-container img { max-width: 200px; height: auto; display: block; }

.serial-container { text-align: right; }
.serial-container label { font-size: 10px; font-weight: 800; text-transform: uppercase; color: #64748b; display: block; margin-bottom: 4px; }
.serial-number { 
    background: #fef2f2; border: 1px solid #fee2e2; color: var(--red); 
    padding: 6px 12px; border-radius: 6px; font-weight: 700; font-size: 13px;
    width: 150px; text-align: center; outline: none;
}

/* TABS */
.tab-container { display: flex; background: #f1f5f9; padding: 6px; border-radius: 12px; margin-bottom: 25px; }
.tab { flex: 1; text-align: center; padding: 10px; cursor: pointer; border-radius: 8px; font-weight: 600; color: #64748b; font-size: 14px; }
.tab.active { background: #fff; color: var(--blue); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }

.section { margin-bottom: 25px; padding-top: 15px; border-top: 1px solid var(--border); }
.section-title { font-size: 11px; font-weight: 800; color: var(--red); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 15px; display: block; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.full-width { grid-column: span 2; }

input, select { width: 100%; padding: 12px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 14px; background: #f8fafc; }
input:focus { border-color: var(--blue); outline: none; background: #fff; }
input, select, textarea { 
    width: 100%; 
    padding: 12px; 
    border: 1.5px solid var(--border); 
    border-radius: 10px; 
    font-size: 14px; 
    background: #f8fafc; 
    transition: 0.2s; 
    resize: none; /* Prevents users from breaking the layout by resizing */
}

textarea:focus { 
    border-color: var(--blue); 
    outline: none; 
    background: #fff; 
}
.canvas-wrapper { border: 1.5px solid var(--border); border-radius: 12px; background: #fff; height: 150px; overflow: hidden; }
#signature-pad { width: 100%; height: 100%; cursor: crosshair; display: block; }

.signature-actions { display: flex; justify-content: space-between; margin-top: 8px; }
.btn-text { background: none; border: none; color: #64748b; cursor: pointer; font-size: 12px; font-weight: 600; }
.btn-primary-small { background: var(--blue); color: #fff; border: none; padding: 6px 14px; border-radius: 6px; font-size: 12px; font-weight: 700; cursor: pointer; }

.main-submit { width: 100%; padding: 16px; background: var(--red); color: white; border: none; border-radius: 12px; font-weight: 700; cursor: pointer; text-transform: uppercase; }
.main-submit:disabled { background: #cbd5e1; cursor: not-allowed; }

/* MODAL */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.9); }
.modal-content { background: #fff; margin: 5% auto; padding: 30px; width: 90%; max-width: 500px; border-radius: 20px; }
.modal-body { height: 250px; overflow-y: auto; border: 1px solid #f1f5f9; padding: 15px; font-size: 13px; line-height: 1.6; color: #475569; }
.legal-check { display: flex; gap: 12px; background: #fef2f2; padding: 15px; border-radius: 10px; margin-top: 15px; align-items: center; }

.hidden { display: none; }
.readonly { background: #f1f5f9 !important; color: #64748b; font-weight: 600; cursor: not-allowed; }
.highlight-red { color: var(--red) !important; }