* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #0a0a0f;
    color: #e0e0e0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.card {
    position: relative;
    background: rgba(22, 27, 45, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 8px 40px;
    padding-top: 48px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.lang-picker {
    position: absolute;
    top: 14px;
    right: 16px;
}

.lang-trigger {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 4px 10px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.lang-trigger:hover {
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.12);
}

.lang-trigger svg {
    flex-shrink: 0;
}

.lang-options {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 150px;
    max-height: 280px;
    overflow-y: auto;
    background: rgba(20, 24, 42, 0.97);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 4px;
    list-style: none;
    z-index: 200;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.lang-picker.open .lang-options {
    display: block;
    animation: dropdownFadeIn 0.2s ease;
}

.lang-options li {
    padding: 7px 12px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.lang-options li:hover {
    background: rgba(99, 135, 255, 0.15);
    color: #fff;
}

.lang-options li.selected {
    color: #818cf8;
    font-weight: 500;
}

.lang-options::-webkit-scrollbar {
    width: 4px;
}

.lang-options::-webkit-scrollbar-track {
    background: transparent;
}

.lang-options::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.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;
}

.logo {
    text-align: center;
    margin-bottom: 24px;
}

.logo-svg {
    width: 240px;
    height: auto;
}

.footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.72rem;
    margin-top: 20px;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    letter-spacing: 0.02em;
}

form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

input[type="text"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 0.95rem;
    color: #fff;
    outline: none;
    transition: border-color 0.2s;
    text-align: center;
}

input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

input[type="text"]:focus {
    border-color: rgba(99, 135, 255, 0.6);
}

.input-wrapper {
    position: relative;
}

input.invalid {
    border-color: #ef4444 !important;
}

.validation-msg {
    font-size: 0.78rem;
    color: #f87171;
    margin-top: 6px;
    text-align: center;
    transition: opacity 0.2s;
}

.validation-msg.hidden {
    display: none;
}

button[type="submit"] {
    background: linear-gradient(135deg, #4a6cf7, #6366f1);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

button[type="submit"]:hover {
    opacity: 0.9;
}

#result {
    margin-top: 28px;
    text-align: center;
}

#result.hidden {
    display: none;
}

.code-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 6px;
}

#codeValue {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: #4ade80;
    font-variant-numeric: tabular-nums;
}

#copyBtn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 10px;
    color: #aaa;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#copyBtn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.copy-feedback {
    font-size: 0.8rem;
    color: #4ade80;
    margin-bottom: 20px;
    height: 20px;
    transition: opacity 0.3s;
}

.copy-feedback.hidden {
    opacity: 0;
}

.timer-container {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0 auto 12px;
}

.timer-ring {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.timer-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 5;
}

.timer-progress {
    fill: none;
    stroke: #4ade80;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-dasharray: 282.74;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.3s;
}

.timer-progress.warning {
    stroke: #f59e0b;
}

.timer-progress.danger {
    stroke: #ef4444;
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.timer-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
}

.toggle-advanced {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 4px 0;
    width: 100%;
    transition: color 0.2s;
}

.toggle-advanced:hover {
    color: rgba(255, 255, 255, 0.7);
}

.toggle-advanced .chevron {
    transition: transform 0.3s;
}

.toggle-advanced.open .chevron {
    transform: rotate(180deg);
}

.advanced-options {
    opacity: 1;
    transition: opacity 0.25s ease;
}

.advanced-options.hidden {
    display: none;
    opacity: 0;
}

.option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.option-row label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.custom-select {
    position: relative;
    min-width: 120px;
}

.select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 0.85rem;
    color: #fff;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.select-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
}

.select-trigger svg {
    color: rgba(255, 255, 255, 0.4);
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.custom-select.open {
    z-index: 100;
}

.custom-select.open .select-trigger {
    border-color: rgba(99, 135, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
}

.custom-select.open .select-trigger svg {
    transform: rotate(180deg);
}

.select-options {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    right: 0;
    background: rgba(20, 24, 42, 0.97);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 4px;
    list-style: none;
    z-index: 50;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.custom-select.open .select-options {
    display: block;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.select-options li {
    padding: 8px 12px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.select-options li:hover {
    background: rgba(99, 135, 255, 0.15);
    color: #fff;
}

.select-options li.selected {
    color: #818cf8;
    font-weight: 500;
}

@media (max-width: 480px) {
    .card {
        padding: 28px 20px;
        border-radius: 16px;
    }

    #codeValue {
        font-size: 2.2rem;
    }
}
