:root {
    --bg: #0b1220;
    --surface: rgba(17, 24, 39, 0.84);
    --surface-2: #111827;
    --surface-3: rgba(255, 255, 255, 0.045);
    --border: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(34, 211, 238, 0.35);
    --text: #e5eefc;
    --muted: #9fb0c7;
    --primary: #22d3ee;
    --primary-2: #06b6d4;
    --success: #22c55e;
    --danger: #ef4444;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    --shadow-strong: 0 25px 80px rgba(0, 0, 0, 0.55);
    --radius: 20px;
}

* {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background:
        radial-gradient(circle at 50% -10%, rgba(34, 211, 238, 0.20), transparent 35%),
        radial-gradient(circle at 100% 50%, rgba(6, 182, 212, 0.07), transparent 30%),
        linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
    color: var(--text);
    line-height: 1.5;
}

::selection {
    background: rgba(34, 211, 238, 0.30);
    color: #ffffff;
}

.container {
    width: min(920px, calc(100% - 24px));
    margin: 24px auto;
    padding: 28px;
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

body > header.container {
    margin-bottom: 14px;
    padding-top: 18px;
    padding-bottom: 18px;
}

body > header nav {
    display: flex;
    align-items: center;
}

body > header nav a {
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.2px;
    transition: 0.2s ease;
}

body > header nav a:hover {
    color: var(--primary);
}

main.container {
    margin-top: 14px;
}

main > header {
    margin-bottom: 30px;
}

h1 {
    margin: 0 0 12px;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.15;
    letter-spacing: 0.2px;
}

h2 {
    margin: 0 0 18px;
    font-size: clamp(1.25rem, 3vw, 1.55rem);
    line-height: 1.25;
}

h3 {
    margin: 0 0 12px;
}

p {
    color: var(--muted);
}

main > header p {
    max-width: 700px;
    margin: 0;
    font-size: 1.03rem;
}

strong {
    color: var(--text);
}

a {
    color: var(--primary);
}

a:hover {
    color: var(--primary-2);
}

#applicationSection {
    padding: 24px;
    margin-bottom: 24px;
    background: var(--surface-3);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

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

.field.full {
    grid-column: 1 / -1;
}

.field > label,
.field > p {
    margin: 0;
}

.field > label {
    color: var(--text);
    font-weight: 700;
}

.small {
    font-size: 0.92rem;
    color: var(--muted);
}

input,
select,
button {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 14px 16px;
    font: inherit;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

input::placeholder {
    color: #7f93ad;
}

input:focus,
select:focus {
    border-color: rgba(34, 211, 238, 0.7);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}

input:hover,
select:hover {
    border-color: rgba(255, 255, 255, 0.20);
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #0b1724;
    color: #eef6ff;
    cursor: pointer;
}

select option {
    background: #111827;
    color: #eef6ff;
}

.checkbox-row {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    padding: 9px 0;
    color: var(--muted);
    line-height: 1.55;
    cursor: pointer;
}

.checkbox-row span {
    flex: 1;
}

.checkbox-row input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    margin: 3px 0 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: 0.18s ease;
}

.checkbox-row input[type="checkbox"]:hover {
    border-color: rgba(34, 211, 238, 0.65);
}

.checkbox-row input[type="checkbox"]:checked {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.10);
}

.checkbox-row input[type="checkbox"]:checked::after {
    content: "✓";
    display: block;
    color: #06202a;
    font-size: 13px;
    font-weight: 900;
    line-height: 17px;
    text-align: center;
}

.checkbox-row input[type="checkbox"]:focus {
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}

.actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 18px;
}

button {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    border: none;
    color: #06202a;
    font-weight: 800;
    cursor: pointer;
    padding: 15px 18px;
    box-shadow: 0 10px 24px rgba(6, 182, 212, 0.22);
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(6, 182, 212, 0.28);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#recordingSection {
    padding: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.025));
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 18px;
}

.recording-instruction {
    padding: 18px 20px;
    border: 1px solid rgba(34, 211, 238, 0.16);
    border-radius: 15px;
    background: rgba(34, 211, 238, 0.045);
    color: var(--muted);
}

.recording-instruction strong {
    color: var(--primary);
}

.status {
    min-height: 24px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.95rem;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.76);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1000;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: modalBackground 0.2s ease;
}

.modal-content {
    width: min(520px, 100%);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background:
        radial-gradient(circle at top, rgba(34, 211, 238, 0.08), transparent 45%),
        #111827;
    border: 1px solid rgba(255, 255, 255, 0.11);
    padding: 28px;
    border-radius: 22px;
    box-shadow: var(--shadow-strong);
    animation: modalOpen 0.22s ease;
}

.modal-content h2 {
    margin-top: 0;
}

.modal-content p {
    margin: 0 0 16px;
}

.modal-content p:last-of-type {
    margin-bottom: 22px;
}

.modal-content button {
    margin-top: 4px;
}

.karaoke-modal {
    width: min(760px, 100%);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 42px 32px;
}

.speak-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    padding: 9px 17px;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.12);
    border: 1px solid rgba(34, 211, 238, 0.30);
    color: var(--primary);
    font-size: 0.95rem;
    font-weight: 900;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    box-shadow: 0 0 25px rgba(34, 211, 238, 0.08);
}

.current-line {
    width: 100%;
    min-height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.09);
    color: #f4f8ff;
    font-size: clamp(1.35rem, 4vw, 2.15rem);
    font-weight: 700;
    line-height: 1.35;
    text-wrap: balance;
}

.progress {
    margin-top: 22px;
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 600;
}

#sentModal .modal-content {
    text-align: center;
    width: min(500px, 100%);
    border-color: rgba(34, 197, 94, 0.25);
}

#sentModal h2 {
    color: var(--success);
    font-size: 1.65rem;
}

#sentModal h2::before {
    content: "";
    display: block;
    width: 58px;
    height: 58px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.30);
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.10);
}

.hidden {
    display: none !important;
}

footer {
    width: min(920px, calc(100% - 24px));
    margin: 28px auto 0;
    padding: 18px 24px;
    text-align: center;
    background: rgba(17, 24, 39, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--muted);
    font-size: 0.9rem;
    border-radius: 16px 16px 0 0;
}

footer p {
    margin: 0;
}

footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: 0.2s ease;
}

footer a:hover {
    color: var(--primary-2);
    text-decoration: underline;
}

@keyframes modalOpen {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modalBackground {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (max-width: 700px) {
    .container {
        width: min(100% - 16px, 920px);
        margin: 8px auto;
        padding: 18px;
    }

    body > header.container {
        margin-bottom: 8px;
    }

    main.container {
        margin-top: 8px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .field.full {
        grid-column: auto;
    }

    #applicationSection,
    #recordingSection {
        padding: 18px;
    }

    input,
    select,
    button {
        padding: 13px 14px;
    }

    .modal {
        padding: 10px;
    }

    .modal-content {
        padding: 22px;
        border-radius: 18px;
    }

    .karaoke-modal {
        min-height: 360px;
        padding: 28px 18px;
    }

    .current-line {
        min-height: 150px;
        padding: 20px 16px;
        font-size: clamp(1.2rem, 6vw, 1.7rem);
    }

    footer {
        width: calc(100% - 16px);
        margin-top: 18px;
        padding: 16px;
        font-size: 0.85rem;
    }
}

@media (max-width: 420px) {
    h1 {
        font-size: 1.7rem;
    }

    .container {
        padding: 14px;
    }

    #applicationSection,
    #recordingSection {
        padding: 15px;
    }

    .modal-content {
        padding: 18px;
    }

    .karaoke-modal {
        min-height: 330px;
    }

    .speak-label {
        margin-bottom: 20px;
        font-size: 0.82rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* NAVIGATION */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    min-height: 64px;
    z-index: 9000;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(12px, 1.8vw, 24px);
    padding: 10px max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));
    background: rgba(5,10,18,.82);
    border-bottom: 1px solid rgba(255,255,255,.10);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    overflow: hidden;
}

.navbar a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 8px 4px;
    color: rgba(255,255,255,.78);
    font-size: clamp(.74rem, 1vw, .9rem);
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    transition: color .25s ease, transform .25s ease;
}

.navbar a:hover {
    color: #fff;
    transform: translateY(-1px);
}

/* HAMBURGER BUTTON */
.hamburger {
    display: none;
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    width: 52px;
    height: 52px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 15px;
    background: rgba(255,255,255,.10);
    color: #fff;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 10000;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    touch-action: manipulation;
}

.hamburger span {
    width: 24px;
    height: 3px;
    background: #fff;
    border-radius: 99px;
}

/* MOBILE MENU OVERLAY */
.menu-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: 100%;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: clamp(14px, 3vh, 25px);
    padding: max(80px, env(safe-area-inset-top) + 60px) max(25px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom) + 20px) max(25px, env(safe-area-inset-left));
    background: rgba(3,8,15,.97);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    opacity: 0;
    pointer-events: none;
    overflow-x: hidden;
    overflow-y: auto;
    transition: opacity .3s ease;
}

.menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.menu-overlay a {
    min-height: 48px;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    color: #fff;
    font-size: clamp(1.1rem, 4vw, 1.35rem);
    font-weight: 700;
    text-decoration: none;
    text-align: center;
}

.menu-overlay a:hover {
    color: var(--cyan);
}

/* RESPONSIVE NAVIGATION */
@media (max-width: 1100px) {
    .navbar {
        gap: 10px;
        padding-left: 14px;
        padding-right: 14px;
    }
    .navbar a {
        font-size: .74rem;
    }
}

@media (max-width: 900px) {
    .navbar {
        display: none;
    }
    .hamburger {
        display: flex;
    }
}

@media (max-width: 480px) {
    .hamburger {
        width: 50px;
        height: 50px;
        border-radius: 14px;
    }
}

@media (max-width: 900px) and (max-height: 600px) {
    .menu-overlay {
        gap: 8px;
    }
    .menu-overlay a {
        min-height: 42px;
        font-size: 1rem;
    }
}

@media print {
    .navbar,
    .hamburger,
    .menu-overlay {
        display: none !important;
    }
}
