* { box-sizing: border-box; }

:root {
    --bg: #0f0f10;
    --card: #1b1b1e;
    --card-2: #242428;
    --text: #f3f3f3;
    --muted: #a7a7a7;
    --line: #33333a;
    --gold: #f0c15a;
    --gold-dark: #bf9433;
    --paper: #ffffff;
    --ink: #111111;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: radial-gradient(circle at top, #28220f 0, var(--bg) 38%, #090909 100%);
    color: var(--text);
}

.nav {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(12, 12, 14, .9);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.nav a { color: var(--text); text-decoration: none; margin-left: 18px; font-weight: 700; }
.nav .brand { margin-left: 0; color: var(--gold); letter-spacing: .5px; }

.container {
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.container.wide { align-items: flex-start; }

.card {
    width: 100%;
    max-width: 860px;
    background: linear-gradient(180deg, rgba(37,37,41,.96), rgba(25,25,28,.96));
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 34px;
    box-shadow: 0 24px 80px rgba(0,0,0,.45);
}

.login-card { max-width: 480px; }
.hero-card { max-width: 780px; }

h1 { margin: 0 0 8px 0; letter-spacing: .5px; }
.subtitle { color: var(--muted); margin-top: 0; }
.eyebrow { color: var(--gold); text-transform: uppercase; font-size: 12px; letter-spacing: 2px; font-weight: 800; }

.flash-wrap { max-width: 860px; margin: 18px auto 0; padding: 0 24px; }
.flash { background: #3a2712; border: 1px solid #7c531f; color: #ffd891; padding: 12px 16px; border-radius: 12px; }

form { display: grid; gap: 14px; margin-top: 24px; }
.form-grid { grid-template-columns: 1fr 1fr; }
.full { grid-column: 1 / -1; }

label { display: block; color: #dedede; font-weight: 700; margin-bottom: 7px; }
input, textarea {
    width: 100%;
    border: 1px solid #44444c;
    border-radius: 12px;
    padding: 12px;
    background: #111114;
    color: var(--text);
    outline: none;
}
input:focus, textarea:focus { border-color: var(--gold); }

button, .button, .secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    padding: 12px 18px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
}
button, .button { background: var(--gold); color: #151515; }
button:hover, .button:hover { background: #ffd16a; }
.secondary { background: #303036; color: var(--text); border: 1px solid #45454d; }

.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 8px; }

.grid-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 30px;
}
.tile {
    display: block;
    text-decoration: none;
    color: var(--text);
    background: var(--card-2);
    border: 1px solid #3b3b42;
    border-radius: 18px;
    padding: 22px;
    min-height: 130px;
}
.tile strong { display: block; color: var(--gold); margin-bottom: 10px; font-size: 18px; }
.tile span { color: var(--muted); line-height: 1.45; }
.tile:hover { border-color: var(--gold-dark); transform: translateY(-1px); }
.tile.muted strong { color: #ddd; }

.table-wrap { overflow-x: auto; margin-top: 20px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); }
th { color: var(--gold); font-size: 13px; text-transform: uppercase; letter-spacing: .8px; }
td a { color: var(--gold); font-weight: 700; }

.document { background: #d6d6d6; min-height: calc(100vh - 64px); padding: 24px; color: var(--ink); }
.topbar { max-width: 940px; margin: 0 auto 18px auto; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.topbar a { color: var(--ink); font-weight: 800; }
.topbar-actions { display: flex; gap: 10px; }
.topbar-actions .secondary { color: var(--text); }

.contract {
    background: var(--paper);
    max-width: 940px;
    margin: 0 auto;
    padding: 58px;
    color: var(--ink);
    line-height: 1.65;
    box-shadow: 0 14px 50px rgba(0,0,0,.28);
}
.contract-number { text-align: right; color: #555; font-size: 13px; }
.contract h1, .contract h2 { text-align: center; }
.contract h2 { color: #444; font-size: 17px; margin-top: -4px; margin-bottom: 30px; }
.contract h3 { margin-top: 28px; }
.signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; margin-top: 64px; }
.line { border-bottom: 1px solid #111; height: 40px; }

@media (max-width: 760px) {
    .form-grid, .grid-actions, .signatures { grid-template-columns: 1fr; }
    .card, .contract { padding: 24px; }
    .topbar { flex-direction: column; align-items: stretch; }
}

@media print {
    .nav, .topbar { display: none; }
    body, .document { background: #fff; padding: 0; }
    .contract { box-shadow: none; max-width: none; padding: 28px; }
}

.field-hint {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 10px;
    color: #dedede;
    font-weight: 700;
}

.checkbox-row input {
    width: auto;
    min-width: 16px;
}

input:disabled {
    opacity: .65;
    cursor: not-allowed;
}

.wide-card { max-width: 1120px; }
.contract-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.contract-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.contract-form label { margin-bottom: 0; }
.contract-form textarea,
.contract-form .hint-box,
.contract-form button,
.contract-form .check-row { grid-column: 1 / -1; }
.required { color: var(--gold); }
.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 8px;
    color: #dedede;
    font-weight: 800;
}
.check-row input { width: auto; min-width: 18px; }
.hint-box {
    display: grid;
    gap: 4px;
    background: rgba(240, 193, 90, .08);
    border: 1px solid rgba(240, 193, 90, .28);
    color: #f0d99d;
    border-radius: 14px;
    padding: 14px;
    line-height: 1.4;
}

@media (max-width: 980px) {
    .contract-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .contract-form, .contract-grid { grid-template-columns: 1fr; }
}
