/* ============ BASE ============ */

:root {
    --primary: #256af4;
    --background-dark: #101622;
    --card-bg: #1a2232;
    --accent: #f97316;
    --accent-hover: #ea580c;
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.8);
    --border-subtle: rgba(255, 255, 255, 0.2);
    --shadow-strong: 0 18px 45px rgba(0, 0, 0, 0.55);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-family: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background-color: #1a1a1a;
    color: var(--text-main);
}

/* Ẩn chỉ cho screen reader (dùng cho input file) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============ LAYOUT ============ */

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 16px 32px;
}

@media (min-width: 640px) {
    .layout {
        padding-inline: 32px;
    }
}

@media (min-width: 1024px) {
    .layout {
        padding-inline: 80px;
    }
}

.site-header {
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
    padding: 12px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
}

.logo-icon {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.logo-icon svg {
    width: 100%;
    height: 100%;
}

.logo-text {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin: 0;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Ẩn nav trên mobile (giống hidden md:flex) */
@media (max-width: 767.98px) {
    .nav-actions {
        display: none;
    }
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: #ffffff;
}

.nav-link--active {
    color: #ffffff;
    font-weight: 700;
}

.page-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 0;
}

.apply-card {
    background-color: #262626;
    border-radius: 0.75rem;
    padding: 32px 20px;
    max-width: 768px;
    width: 100%;
    box-shadow: var(--shadow-strong);
}

@media (min-width: 768px) {
    .apply-card {
        padding: 48px 40px;
    }
}

.apply-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 32px;
}

@media (min-width: 768px) {
    .apply-title {
        font-size: 2.25rem;
    }
}

/* ============ FORM ============ */

.apply-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

/* Input, select, textarea chung */
.form-control {
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid var(--border-subtle);
    background-color: #101622;
    padding: 10px 16px;
    font-size: 0.95rem;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.6);
}

/* Select */
.select-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #ffffff 50%),
        linear-gradient(135deg, #ffffff 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(50% - 3px),
        calc(100% - 12px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

/* Textarea */
.textarea-control {
    resize: vertical;
    min-height: 120px;
}

/* ============ FILE UPLOAD ============ */

.file-upload {
    margin-top: 4px;
}

.file-upload-inner {
    border-radius: 0.75rem;
    border: 2px dashed var(--border-subtle);
    padding: 20px 16px;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

.file-upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 8px;
    color: rgba(255, 255, 255, 0.6);
}

.file-upload-text {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
}

.file-upload-label {
    position: relative;
    cursor: pointer;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    padding-inline: 4px;
}

.file-upload-label:hover {
    color: var(--accent-hover);
}

.file-upload-or {
    margin: 0;
    padding-left: 4px;
    font-size: 0.875rem;
}

.file-upload-note {
    margin-top: 4px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

/* ============ BUTTONS ============ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: none;
    outline: none;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
}

.btn-primary {
    padding: 10px 16px;
    background-color: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #1e56cc;
}

.btn-submit {
    width: 100%;
    padding: 12px 18px;
    background-color: var(--accent);
    color: #ffffff;
    box-shadow: 0 10px 25px rgba(249, 115, 22, 0.3);
}

.btn-submit:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 12px 30px rgba(234, 88, 12, 0.35);
}

.btn:active {
    transform: translateY(1px);
}

.btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.9);
}

/* Form actions */
.form-actions {
    margin-top: 8px;
}

#CV {
    display: flex;
    flex-direction: column;
    padding-bottom: 10px;
}

#CV label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px !important;
    font-weight: 500;
}

#CV input[type="file"] {
    padding: 12px;
    border: 2px dashed var(--border);
    border-radius: 8px;
    cursor: pointer;
}

#CV input[type="file"]:hover {
    border-color: var(--primary);
}

#resume {
    font-size: 16px;
    background-color: #101622;
}

/* ============================================================
   APPLY (galaxy) — form ứng tuyển 1 cột trong panel neon.
   (Nền galaxy + hero page-header + sao + mascot roamer kế thừa index.css/index.js.)
============================================================ */
.kc-apply {
    position: relative;
}
.kc-apply .container {
    position: relative;
    z-index: 1;
}
/* CŨ: panel tối + viền neon bao ngoài — xem git history
.kc-apply-panel {
    max-width: 760px;
    margin: 0 auto;
    background: rgba(6, 20, 16, 0.55);
    border: 1px solid rgba(61, 248, 127, 0.35);
    border-radius: 12px;
    padding: 1.8rem;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45),
        inset 0 0 30px rgba(32, 240, 122, 0.05);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
*/
/* MỚI: bỏ khung/nền panel, chỉ giữ căn giữa 760px — field tự có khung ảnh */
.kc-apply-panel {
    max-width: 760px;
    margin: 0 auto;
}
.kc-apply-panel form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.kc-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 560px) {
    .kc-form-row {
        grid-template-columns: 1fr;
    }
}

/* Field tối + icon */
.kc-field {
    position: relative;
    display: flex;
    align-items: center;
}
/* CŨ: icon bên trái + input/select/textarea viền CSS + nền tối — xem git history
.kc-field > i {
    position: absolute;
    left: 12px;
    top: 14px;
    color: rgba(61, 248, 127, 0.75);
    font-size: 1.1rem;
    pointer-events: none;
}
.kc-field input,
.kc-field select,
.kc-field textarea {
    width: 100%;
    background: rgba(2, 8, 6, 0.6);
    border: 1px solid rgba(61, 248, 127, 0.28);
    border-radius: 8px;
    color: #e5e7eb;
    font-family: "Montserrat", sans-serif;
    font-size: 0.95rem;
    padding: 12px 12px 12px 38px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.kc-field textarea {
    resize: vertical;
    min-height: 120px;
}
.kc-field input::placeholder,
.kc-field textarea::placeholder {
    color: rgba(229, 231, 235, 0.45);
}
.kc-field input:focus,
.kc-field select:focus,
.kc-field textarea:focus {
    border-color: var(--kc-green, #3df87f);
    box-shadow: 0 0 0 2px rgba(61, 248, 127, 0.18);
}
.kc-field--select > i {
    left: auto;
    right: 14px;
}
.kc-field--select select {
    padding-left: 14px;
    padding-right: 38px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}
.kc-field--select select option {
    background: #041209;
    color: #e5e7eb;
}
.kc-field--file {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}
.kc-field--file label {
    color: rgba(229, 231, 235, 0.85);
    font-size: 0.9rem;
}
.kc-field--file input[type="file"] {
    width: 100%;
    padding: 10px 12px;
    background: rgba(2, 8, 6, 0.6);
    border: 1px dashed rgba(61, 248, 127, 0.4);
    border-radius: 8px;
    color: #cbd5d0;
    font-size: 0.9rem;
}
*/

/* MỚI: icon bên PHẢI + nền field = ẢNH khung có sẵn (giống trang liên hệ) */
.kc-field > i {
    position: absolute;
    right: 14px;
    top: 15px;
    color: rgba(105, 147, 132, 0.85);
    font-size: 1.15rem;
    pointer-events: none;
    z-index: 1;
}
.kc-field input,
.kc-field select,
.kc-field textarea {
    width: 100%;
    background: url("/public/Image/New_website/index/fr_8 1.png") center / 100% 100% no-repeat;
    border: none;
    color: #e5e7eb;
    font-family: "Montserrat", sans-serif;
    font-size: 0.95rem;
    padding: 15px 42px 15px 18px;
    outline: none;
    transition: filter 0.2s ease;
}
.kc-field textarea {
    background-image: url("/public/Image/New_website/index/fr_9 1.png");
    resize: none;
    min-height: 150px;
    padding-top: 16px;
}
.kc-field input::placeholder,
.kc-field textarea::placeholder {
    color: rgba(229, 231, 235, 0.55);
}
.kc-field input:focus,
.kc-field select:focus,
.kc-field textarea:focus {
    filter: drop-shadow(0 0 8px rgba(32, 240, 122, 0.45));
}

/* Select: chevron bên phải (đã có sẵn từ .kc-field > i) + bỏ mũi tên native */
.kc-field--select select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}
.kc-field--select select option {
    background: #041209;
    color: #e5e7eb;
}

/* File CV: label trên + ô chọn file dùng khung ảnh */
.kc-field--file {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}
.kc-field--file label {
    color: rgba(229, 231, 235, 0.85);
    font-size: 0.9rem;
}
.kc-field--file input[type="file"] {
    width: 100%;
    padding: 15px 18px;
    background: url("/public/Image/New_website/index/fr_8 1.png") center / 100% 100% no-repeat;
    border: none;
    color: #cbd5d0;
    font-size: 0.9rem;
}

/* Nút gửi (btn.png xanh) */
.kc-apply-btn {
    align-self: flex-start;
    margin-top: 0.4rem;
    background: url("/public/Image/New_website/index/btn.png") center / 100% 100% no-repeat;
    border: none;
    cursor: pointer;
    height: 48px;
    min-width: 200px;
    padding: 0 30px;
    color: #06341a;
    font-family: "Montserrat", sans-serif;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: none;
    transition: transform 0.15s ease, filter 0.15s ease;
}
.kc-apply-btn:hover {
    transform: scale(1.04);
    filter: drop-shadow(0 0 12px rgba(32, 240, 122, 0.6));
}
.kc-apply-btn:disabled {
    opacity: 0.6;
    cursor: default;
}