/* Thailand Triple S Awards — light theme (navy + orange on white). */
:root {
  --blue: #123a8f; --blue-2: #1e56c9; --blue-ink: #0d2560;
  --orange: #ff7a1a; --orange-2: #ff9a3d;
  --ink: #16233f; --ink-dim: #4a5878; --ink-mute: #8a93a8;
  --bg: #f4f7fd; --card: #ffffff; --line: #e4e9f4;
  --grad: linear-gradient(135deg, #1e56c9, #123a8f);
  --grad-orange: linear-gradient(135deg, #ff9a3d, #ff7a1a);
  --radius: 16px; --shadow: 0 18px 44px -24px rgba(18, 58, 143, .5);
  --font: 'Anuphan', 'Segoe UI', Tahoma, sans-serif;
  --display: 'Outfit', var(--font);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.55; }
a { color: var(--blue-2); }
img { max-width: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 22px; }

/* Header */
.aw-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.aw-header .wrap { display: flex; align-items: center; gap: 14px; height: 66px; }
.aw-logo img { height: 42px; display: block; }
.aw-brand { font-weight: 800; color: var(--blue-ink); font-size: 1.02rem; line-height: 1.1; }
.aw-brand small { display: block; color: var(--ink-mute); font-weight: 600; font-size: .74rem; letter-spacing: .02em; }
.aw-header .spacer { margin-left: auto; }
.aw-header .back { color: var(--ink-dim); text-decoration: none; font-weight: 700; font-size: .9rem; }

/* Hero */
.aw-hero { background: var(--grad); color: #fff; padding: 54px 0 62px; position: relative; overflow: hidden; }
.aw-hero::after { content: ''; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%; background: rgba(255, 122, 26, .25); filter: blur(10px); }
.aw-hero .wrap { position: relative; z-index: 1; }
.aw-eyebrow { display: inline-block; background: rgba(255, 255, 255, .16); color: #fff; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: .8rem; letter-spacing: .06em; }
.aw-hero h1 { font-family: var(--display); font-weight: 900; font-size: clamp(1.9rem, 5vw, 3rem); margin: 16px 0 8px; }
.aw-hero p { max-width: 640px; color: #dbe4fb; font-size: 1.05rem; }
.aw-hero .deadline { margin-top: 18px; display: inline-flex; gap: 8px; align-items: center; background: var(--grad-orange); color: #3a1c00; font-weight: 800; padding: 9px 18px; border-radius: 12px; }

/* Award cards */
.aw-section { padding: 46px 0 60px; }
.aw-section h2 { font-family: var(--display); font-weight: 800; font-size: 1.5rem; color: var(--blue-ink); margin: 0 0 6px; }
.aw-section .sub { color: var(--ink-mute); margin-bottom: 26px; }
.aw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }
.aw-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; text-decoration: none; color: inherit; }
.aw-card:hover { transform: translateY(-4px); box-shadow: 0 26px 54px -22px rgba(18, 58, 143, .55); }
.aw-card .badge { align-self: flex-start; background: rgba(30, 86, 201, .1); color: var(--blue-2); font-weight: 800; font-size: .72rem; padding: 4px 11px; border-radius: 999px; letter-spacing: .03em; }
.aw-card h3 { font-family: var(--display); font-weight: 800; color: var(--blue-ink); font-size: 1.18rem; margin: 14px 0 4px; }
.aw-card .th { font-weight: 700; color: var(--ink); }
.aw-card .desc { color: var(--ink-dim); font-size: .92rem; margin: 10px 0 18px; flex: 1; }
.aw-card .cta { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: var(--orange); }
.aw-card .bar { height: 5px; border-radius: 999px; background: var(--grad-orange); margin-bottom: 2px; }

/* Form */
.form-shell { max-width: 820px; margin: 0 auto; }
.form-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px; margin-top: 26px; }
.aw-field { margin-bottom: 18px; }
.aw-field > label { display: block; font-weight: 700; color: var(--ink); margin-bottom: 7px; }
.aw-field .req { color: var(--orange); }
.aw-field .help { color: var(--ink-mute); font-size: .84rem; margin-top: 5px; }
.aw-field input[type=text], .aw-field input[type=number], .aw-field input[type=email], .aw-field input[type=tel], .aw-field textarea, .aw-field select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; font: inherit; color: var(--ink); background: #fbfcff; transition: border-color .15s, box-shadow .15s;
}
.aw-field input:focus, .aw-field textarea:focus, .aw-field select:focus { outline: none; border-color: var(--blue-2); box-shadow: 0 0 0 3px rgba(30, 86, 201, .12); }
.aw-field textarea { min-height: 110px; resize: vertical; }
.aw-field.invalid input, .aw-field.invalid textarea, .aw-field.invalid select { border-color: #e0505d; box-shadow: 0 0 0 3px rgba(224, 80, 93, .12); }
/* Rich text editor */
.aw-rt { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: #fbfcff; transition: border-color .15s, box-shadow .15s; }
.aw-rt:focus-within { border-color: var(--blue-2); box-shadow: 0 0 0 3px rgba(30, 86, 201, .12); }
.aw-rt-tools { display: flex; gap: 4px; padding: 6px 8px; background: #eef3ff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.aw-rt-tools button { border: 1px solid transparent; background: #fff; border-radius: 7px; padding: 4px 11px; cursor: pointer; font-size: .85rem; color: var(--ink); }
.aw-rt-tools button:hover { border-color: var(--line); background: #f4f7fd; }
.aw-rt-edit { min-height: 120px; padding: 12px 14px; outline: none; font: inherit; color: var(--ink); line-height: 1.6; }
.aw-rt-edit ul, .aw-rt-edit ol { margin: 6px 0; padding-left: 24px; }
.aw-field.invalid .aw-rt { border-color: #e0505d; box-shadow: 0 0 0 3px rgba(224, 80, 93, .12); }

.aw-heading { font-family: var(--display); font-weight: 800; color: #fff; background: var(--grad); padding: 12px 18px; border-radius: 11px; margin: 28px 0 16px; font-size: 1.05rem; }
.aw-heading:first-child { margin-top: 0; }
.aw-note { background: #eef3ff; border-left: 4px solid var(--blue-2); border-radius: 8px; padding: 11px 14px; color: var(--ink-dim); font-size: .9rem; margin-bottom: 18px; }
.wordcount { float: right; color: var(--ink-mute); font-size: .78rem; font-weight: 600; }
.wordcount.over { color: #e0505d; }

/* Options */
.aw-opts { display: flex; flex-direction: column; gap: 9px; }
.aw-opt { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcff; cursor: pointer; }
.aw-opt input { margin-top: 3px; accent-color: var(--orange); }
.aw-opt:has(input:checked) { border-color: var(--orange); background: rgba(255, 122, 26, .08); }

/* Repeatable table */
.aw-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.aw-table { border-collapse: collapse; width: 100%; min-width: 560px; }
.aw-table th { background: #eef3ff; color: var(--blue-ink); font-size: .82rem; font-weight: 700; padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.aw-table td { padding: 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.aw-table td input, .aw-table td textarea { width: 100%; min-width: 120px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; }
.aw-table td.rm { width: 34px; text-align: center; }
.aw-row-del { border: none; background: #ffe9ea; color: #d64550; width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-weight: 800; }
.aw-add-row { margin-top: 10px; }

/* File upload */
.aw-drop { border: 2px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center; color: var(--ink-mute); cursor: pointer; background: #fbfcff; transition: border-color .15s, background .15s; }
.aw-drop:hover, .aw-drop.drag { border-color: var(--blue-2); background: #eef3ff; }
.aw-files { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.aw-files li { display: flex; align-items: center; gap: 8px; background: #f4f7fd; border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; font-size: .86rem; }
.aw-files .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aw-files .fx { border: none; background: none; color: #d64550; cursor: pointer; font-weight: 800; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; cursor: pointer; font: inherit; font-weight: 800; padding: 13px 26px; border-radius: 12px; text-decoration: none; transition: transform .15s, box-shadow .15s, background .15s; }
.btn-primary { background: var(--grad-orange); color: #3a1c00; box-shadow: 0 12px 26px -12px rgba(255, 122, 26, .7); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-blue { background: var(--grad); color: #fff; }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { background: #f4f7fd; }
.btn-sm { padding: 8px 14px; font-size: .86rem; border-radius: 10px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-lg { padding: 15px 34px; font-size: 1.05rem; }

/* Success + misc */
.aw-success { text-align: center; padding: 40px 20px; }
.aw-success .big { font-size: 3rem; }
.aw-ref { display: inline-block; background: #eef3ff; color: var(--blue-ink); font-weight: 800; padding: 8px 18px; border-radius: 10px; letter-spacing: .04em; margin: 12px 0; }
.aw-overlay { position: fixed; inset: 0; background: rgba(20, 35, 63, .5); display: none; place-items: center; z-index: 50; }
.aw-overlay.show { display: grid; }
.aw-spin { width: 42px; height: 42px; border: 4px solid #fff; border-top-color: var(--orange); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.aw-loading { text-align: center; padding: 60px; color: var(--ink-mute); }
.aw-footer { border-top: 1px solid var(--line); background: #fff; padding: 22px 0; color: var(--ink-mute); font-size: .86rem; }
.toast-host { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 11px; font-weight: 600; box-shadow: var(--shadow); animation: tin .2s ease; }
.toast.error { background: #d64550; } .toast.success { background: #1a9e57; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }
