/* ==========================================================================
   Swiss Pharmaceuticals - HR Careers Portal
   Shared design tokens, layout, form and component styles.
   ========================================================================== */

:root {
    --brand:        #0f7b3d;
    --brand-dark:   #0b5c2e;
    --brand-light:  #e8f5ee;
    --brand-ring:   rgba(15, 123, 61, .18);

    --ink:          #0f172a;
    --ink-2:        #334155;
    --muted:        #64748b;
    --line:         #e2e8f0;
    --line-soft:    #eef2f7;
    --bg:           #f6f8fb;
    --white:        #ffffff;

    --amber:        #b45309;
    --amber-bg:     #fef3c7;
    --blue:         #1d4ed8;
    --blue-bg:      #dbeafe;
    --red:          #b91c1c;
    --red-bg:       #fee2e2;
    --purple:       #6d28d9;
    --purple-bg:    #ede9fe;

    --radius:       14px;
    --radius-sm:    9px;
    --shadow-sm:    0 1px 2px rgba(15, 23, 42, .06);
    --shadow:       0 4px 16px rgba(15, 23, 42, .08);
    --shadow-lg:    0 18px 44px rgba(15, 23, 42, .14);
    --max:          1180px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink-2);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--ink); margin: 0 0 .5rem; line-height: 1.25; font-weight: 700; }
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.08rem; }
p  { margin: 0 0 1rem; }
a  { color: var(--brand-dark); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 22px; }
.wrap-narrow { max-width: 940px; margin: 0 auto; padding: 0 22px; }

/* ------------------------------------------------------------------ header */

.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 40;
}
.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    height: 74px;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand img { height: 38px; width: auto; display: block; }
.brand-divider { width: 1px; height: 30px; background: var(--line); }
.brand-text { font-size: .82rem; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

.site-nav { display: flex; align-items: center; gap: 8px; }
.site-nav a {
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    color: var(--ink-2);
    text-decoration: none;
    font-weight: 600;
    font-size: .92rem;
}
.site-nav a:hover { background: var(--line-soft); color: var(--ink); }
.site-nav a.active { color: var(--brand-dark); background: var(--brand-light); }

/* ------------------------------------------------------------------ buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font: inherit;
    font-weight: 600;
    font-size: .93rem;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s, transform .05s;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { background: var(--white); border-color: var(--line); color: var(--ink-2); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand-dark); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-soft); }
.btn-danger { background: var(--white); border-color: #fecaca; color: var(--red); }
.btn-danger:hover { background: var(--red-bg); }
.btn-sm { padding: 7px 13px; font-size: .85rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }

/* -------------------------------------------------------------------- cards */

.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-pad { padding: 24px; }

/* ------------------------------------------------------------------- badges */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .02em;
    background: var(--line-soft);
    color: var(--ink-2);
    white-space: nowrap;
}
.badge-green  { background: var(--brand-light); color: var(--brand-dark); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue); }
.badge-amber  { background: var(--amber-bg);  color: var(--amber); }
.badge-red    { background: var(--red-bg);    color: var(--red); }
.badge-purple { background: var(--purple-bg); color: var(--purple); }
.badge-grey   { background: #e2e8f0; color: #475569; }

/* -------------------------------------------------------------------- forms */

.field { margin-bottom: 16px; }
.field > label,
.field-label {
    display: block;
    font-weight: 600;
    font-size: .85rem;
    color: var(--ink);
    margin-bottom: 6px;
}
.field-label .req, label .req { color: var(--red); margin-left: 2px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 5px; }

input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
input[type="date"], input[type="search"], input[type="password"], select, textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: .93rem;
    color: var(--ink);
    background: var(--white);
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-ring);
}
input.invalid, select.invalid, textarea.invalid { border-color: #f87171; background: #fff7f7; }
textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: #94a3b8; }
input[type="file"] { padding: 9px; background: var(--white); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Radio / checkbox groups rendered as selectable chips */
.choice-group { display: flex; flex-wrap: wrap; gap: 9px; }
.choice {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--white);
    cursor: pointer;
    font-size: .89rem;
    font-weight: 500;
    color: var(--ink-2);
    transition: all .15s;
    user-select: none;
}
.choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.choice:hover { border-color: #cbd5e1; background: #fbfdfc; }
.choice.checked {
    border-color: var(--brand);
    background: var(--brand-light);
    color: var(--brand-dark);
    font-weight: 600;
    box-shadow: 0 0 0 1px var(--brand) inset;
}
.choice-dot {
    width: 15px; height: 15px;
    border-radius: 50%;
    border: 1.5px solid #cbd5e1;
    flex: none;
    position: relative;
    background: #fff;
}
.choice.square .choice-dot { border-radius: 4px; }
.choice.checked .choice-dot { border-color: var(--brand); background: var(--brand); }
.choice.checked .choice-dot::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: #fff;
}
.choice.square.checked .choice-dot::after {
    width: 4px; height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    border-radius: 0;
    background: none;
    transform: rotate(42deg) translateY(-1px);
}

.check-line { display: flex; align-items: flex-start; gap: 10px; font-size: .92rem; }
.check-line input[type="checkbox"] { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--brand); flex: none; }

/* ------------------------------------------------------------------- alerts */

.alert {
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    margin-bottom: 16px;
    border: 1px solid transparent;
}
.alert-error   { background: var(--red-bg);   color: var(--red);   border-color: #fecaca; }
.alert-success { background: var(--brand-light); color: var(--brand-dark); border-color: #bbf7d0; }
.alert-info    { background: var(--blue-bg);  color: var(--blue);  border-color: #bfdbfe; }

/* ------------------------------------------------------------------- states */

.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty-icon { font-size: 2.6rem; margin-bottom: 10px; opacity: .55; }
.loading { text-align: center; padding: 48px; color: var(--muted); }
.spinner {
    width: 30px; height: 30px;
    border: 3px solid var(--line);
    border-top-color: var(--brand);
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------- footer */

.site-footer {
    background: var(--ink);
    color: #94a3b8;
    padding: 34px 0;
    margin-top: 64px;
    font-size: .88rem;
}
.site-footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: #cbd5e1; text-decoration: none; }
.site-footer a:hover { color: #fff; }

/* -------------------------------------------------------------------- toast */

.toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 10px; }
.toast {
    background: var(--ink);
    color: #fff;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-size: .9rem;
    animation: rise .2s ease-out;
}
.toast.ok  { background: var(--brand-dark); }
.toast.err { background: #991b1b; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* -------------------------------------------------------------------- misc */

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono  { font-family: "Consolas", "SF Mono", monospace; }
.center { text-align: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.stack-sm > * + * { margin-top: 8px; }
.nowrap { white-space: nowrap; }

@media (max-width: 860px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .site-header .wrap { height: auto; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
    .brand-divider, .brand-text { display: none; }
    h1 { font-size: 1.6rem; }
}
