/* ===== Base ===== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #222;
    background: #f6f7f9;
    -webkit-font-smoothing: antialiased;
}
a { color: #2563eb; }
.muted { color: #6b7280; font-size: 0.9em; }
.error { color: #b91c1c; margin-top: 12px; }
.hint { color: #6b7280; font-size: 0.85em; margin-top: 6px; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-primary {
    background: #111827;
    color: white;
}
.btn-primary:hover { background: #000; }
.btn-primary:disabled { background: #9ca3af; cursor: not-allowed; }
.btn-ghost {
    background: transparent;
    color: #374151;
    border-color: #d1d5db;
}
.btn-ghost:hover { background: #f3f4f6; }

/* ===== Login page ===== */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}
.login-card {
    background: white;
    padding: 48px 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    max-width: 440px;
    width: calc(100% - 32px);
    text-align: center;
}
.brand h1 { margin: 0 0 4px 0; font-size: 28px; }
.brand .subtitle { margin: 0 0 4px 0; color: #4b5563; }
.brand .org { margin: 0 0 24px 0; font-size: 12px; color: #9ca3af; letter-spacing: 0.5px; text-transform: uppercase; }
.signin p { margin: 0 0 16px 0; color: #374151; }
.signin .g_id_signin { display: inline-block; margin-top: 8px; }
.login-footer { margin-top: 32px; padding-top: 16px; border-top: 1px solid #e5e7eb; }
.login-footer small { color: #9ca3af; }

/* ===== Form page ===== */
.form-body {
    background: #f6f7f9;
}
.topbar {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar-title strong { margin-right: 12px; }
.topbar-user { display: flex; gap: 12px; align-items: center; }

.form-container {
    max-width: 820px;
    margin: 32px auto;
    padding: 0 16px;
}

.contract-form {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    padding: 32px;
}
.contract-form section {
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid #f3f4f6;
}
.contract-form section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}
.contract-form h2 {
    font-size: 16px;
    margin: 0 0 16px 0;
    color: #111827;
    border-left: 3px solid #fbbf24;
    padding-left: 10px;
}
.field {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
    flex: 1;
}
.field label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
}
.field .req { color: #dc2626; }
.field input, .field select, .field textarea {
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    font-family: inherit;
    color: #111827;
}
.field input:focus {
    outline: none;
    border-color: #fbbf24;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2);
}
.row {
    display: flex;
    gap: 16px;
}
.row .field { margin-bottom: 14px; }
@media (max-width: 640px) {
    .row { flex-direction: column; gap: 0; }
}

.actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
}
.status { font-size: 14px; }
.status.error { color: #b91c1c; }
.status.success { color: #047857; }

.result {
    margin-top: 24px;
    padding: 20px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
}
.result h3 { margin: 0 0 8px 0; color: #065f46; }
.result p { margin: 4px 0; }
.result a { font-weight: 600; }
