:root {
    --bg: #2b2b2b;
    --text: #ffffff;
    --text-soft: rgba(255, 255, 255, 0.64);
    --text-muted: rgba(255, 255, 255, 0.38);
    --card: rgba(255, 255, 255, 0.08);
    --card-hover: rgba(255, 255, 255, 0.14);
    --line: rgba(255, 255, 255, 0.12);
    --line-strong: rgba(255, 255, 255, 0.22);
    --danger: #ff6b70;
    --success: #78d75d;
    --accent: #ffffff;
    --radius: 12px;
}

* {
    box-sizing: border-box;
    letter-spacing: 0;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Montserrat", "Segoe UI", system-ui, sans-serif;
    overflow-x: hidden;
}

a {
    color: inherit;
}

.page {
    min-height: 100dvh;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 36px;
    padding: 48px 64px;
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

.bg-shape {
    position: fixed;
    pointer-events: none;
    z-index: -1;
    opacity: 0.88;
}

.bg-shape.one {
    width: 136vw;
    left: 76%;
    top: 44%;
    transform: translate(-50%, -50%);
}

.bg-shape.two {
    width: 112vw;
    left: 76%;
    top: 44%;
    transform: translate(-50%, -50%);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    animation: slide-down 0.7s ease-in-out both;
}

@keyframes slide-down {
    from { transform: translateY(-96px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.brand {
    display: flex;
    align-items: center;
    gap: 20px;
}

.brand-link {
    text-decoration: none;
}

.brand-icon {
    width: 32px;
    height: 39px;
    border-radius: 6px;
    display: grid;
    place-items: center;
}

.brand-icon img {
    width: 100%;
    height: 100%;
    display: block;
}

.brand-text strong {
    display: block;
    font-size: 20px;
    line-height: 1.22;
    font-weight: 700;
}

.brand-text span {
    display: block;
    margin-top: -2px;
    color: rgba(255, 255, 255, 0.48);
    font-size: 16px;
    line-height: 1.22;
    font-weight: 300;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: clamp(24px, 4vw, 72px);
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-links a {
    color: var(--text-soft);
    font-size: 16px;
    line-height: 1.22;
    font-weight: 300;
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    color: var(--text);
}

.lang {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 4px 8px;
    height: 40px;
    background: var(--card);
    color: var(--text);
    font-size: 16px;
    font-weight: 300;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.lang-selector {
    position: relative;
    flex: 0 0 auto;
}

.lang:hover,
.lang:focus-visible {
    background: var(--card-hover);
}

.lang-caret {
    display: inline-block;
    width: 12px;
    height: 12px;
    line-height: 1;
    transform: translateY(-1px);
    transition: transform 0.2s ease;
}

.lang-flag {
    width: 20px;
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--bg);
    list-style: none;
    padding: 6px;
    margin: 0;
    display: none;
    z-index: 10;
}

.lang-menu li {
    width: 100%;
}

.lang-option {
    width: 100%;
    border: 0;
    display: block;
    border-radius: 8px;
    padding: 8px 10px;
    background: transparent;
    color: var(--text-soft);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.lang-option:hover,
.lang-option.is-active {
    background: var(--card-hover);
    color: var(--text);
}

.lang-selector.is-open .lang-menu {
    display: block;
    animation: fade-down 0.2s ease-in-out forwards;
}

@keyframes fade-down {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

.lang-selector.is-open .lang-caret {
    transform: rotate(180deg);
}

.support-layout {
    display: grid;
    grid-template-columns: minmax(280px, 520px) minmax(0, 820px);
    align-items: start;
    gap: clamp(32px, 5vw, 80px);
}

.hero-copy {
    min-height: calc(100dvh - 156px);
    display: grid;
    align-content: center;
    gap: 24px;
    padding-bottom: 8vh;
}

.eyebrow {
    width: fit-content;
    margin: 0;
    border: 1px solid var(--card);
    border-radius: var(--radius);
    background: var(--card);
    padding: 8px 14px;
    color: var(--text-soft);
    font-size: 15px;
    line-height: 1.22;
    font-weight: 500;
    animation: fade-up 0.45s ease-in-out both;
}

.hero-copy h1 {
    margin: 0;
    max-width: 10ch;
    font-size: clamp(42px, 5vw, 64px);
    line-height: 1.08;
    font-weight: 600;
    animation: fade-up 0.55s ease-in-out both;
}

.hero-copy h1 span {
    font-weight: 300;
}

.hero-copy > p:not(.eyebrow) {
    max-width: 42ch;
    margin: 0;
    color: var(--text-soft);
    font-size: clamp(16px, 1.8vw, 22px);
    line-height: 1.35;
    font-weight: 200;
    animation: fade-up 0.7s ease-in-out both;
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(48px); }
    to { opacity: 1; transform: translateY(0); }
}

.workspace {
    display: grid;
    gap: 16px;
    padding-bottom: 48px;
}

.panel {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.075);
    backdrop-filter: blur(18px);
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    animation: fade-up 0.6s ease-in-out both;
}

.form-panel {
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(8px);
}

.tickets-panel {
    animation-delay: 0.12s;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 24px;
    border-bottom: 1px solid var(--line);
}

.panel-kicker {
    margin: 0 0 6px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.22;
    font-weight: 300;
}

.panel-header h2 {
    margin: 0;
    color: var(--text);
    font-size: clamp(22px, 2vw, 30px);
    line-height: 1.22;
    font-weight: 600;
}

.panel-badge {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    padding: 8px 12px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 400;
}

.panel-body {
    padding: 24px;
}

.section-title {
    margin: 0 0 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    font-size: 18px;
    line-height: 1.22;
    font-weight: 600;
}

.verification-section {
    margin-bottom: 32px !important;
}

.details-section {
    transition: opacity 0.2s ease;
}

.form-label {
    color: var(--text);
    font-size: 14px;
    font-weight: 500 !important;
}

.form-text,
.text-muted,
small.text-muted {
    color: var(--text-muted) !important;
}

.form-control,
.form-select,
.input-group-text {
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font-weight: 400;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control,
.form-select {
    padding: 0.76rem 1rem;
}

.input-group-text {
    color: var(--text-soft);
}

.input-group > .form-control,
.input-group > .form-select {
    border-left: 0;
}

.input-group > .input-group-text:first-child {
    border-right: 0;
}

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

.form-select {
    color-scheme: dark;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--line-strong);
    background-color: rgba(255, 255, 255, 0.12);
    color: var(--text);
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.08);
}

.form-control:disabled,
.form-select:disabled,
.form-control[readonly] {
    background-color: rgba(255, 255, 255, 0.045);
    color: var(--text-muted);
    opacity: 1;
}

textarea.form-control {
    resize: vertical;
}

.btn {
    border-radius: var(--radius);
    font-weight: 600;
}

.btn-primary,
.btn-success {
    border: 1px solid var(--card-hover);
    background: var(--card);
    color: var(--text);
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-success:hover,
.btn-success:focus {
    border-color: var(--card-hover);
    background: var(--card-hover);
    color: var(--text);
    transform: translateY(-1px);
}

.btn-secondary,
.btn-outline-danger {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-soft);
}

.btn-secondary:hover,
.btn-outline-danger:hover {
    border-color: var(--line-strong);
    background: var(--card-hover);
    color: var(--text);
}

.btn.disabled,
.btn:disabled {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    opacity: 1;
}

#submitBtn {
    min-width: min(100%, 240px);
    min-height: 52px;
}

#alertContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    width: min(420px, calc(100vw - 40px));
}

.alert {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(25, 25, 25, 0.92);
    color: var(--text);
}

.alert-danger {
    border-color: rgba(255, 107, 112, 0.42);
}

.alert-success {
    border-color: rgba(120, 215, 93, 0.42);
}

.alert-info {
    border-color: rgba(255, 255, 255, 0.22);
}

.alert-light {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.btn-close {
    filter: invert(1) grayscale(1);
    opacity: 0.7;
}

.floating-alert {
    position: static;
    margin: 0;
    animation: slide-in 0.3s ease both;
}

@keyframes slide-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.loading-spinner {
    display: none;
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid rgba(255, 255, 255, 0.18);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.ticket-item {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.075);
    padding: 18px;
    margin-bottom: 12px;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.ticket-item:hover {
    border-color: var(--line-strong);
    background: var(--card-hover);
    transform: translateY(-1px);
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 0.5rem;
}

.ticket-title {
    margin-bottom: 0.25rem;
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
}

.ticket-key {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.ticket-summary {
    color: var(--text-soft);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.ticket-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-bottom: 0.5rem;
}

.status-badge,
.badge {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card) !important;
    color: var(--text-soft);
    padding: 0.28rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-open { color: #9be383; }
.status-in-progress { color: #a9d9ff; }
.status-resolved { color: #78d75d; }
.status-closed { color: #ff9da1; }

.ticket-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.no-tickets {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.no-tickets-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.modal-content {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(43, 43, 43, 0.98);
    color: var(--text);
}

.modal-header,
.modal-footer {
    border-color: var(--line);
}

.modal-title {
    font-weight: 600;
}

.modal-lg {
    max-width: 800px;
}

.summary-content {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.06) !important;
    color: var(--text-soft);
    padding: 1.25rem;
    font-size: 1rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.summary-line {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.summary-line strong {
    color: var(--text);
    margin-right: 0.5rem;
}

.comment-section {
    border-color: var(--line) !important;
}

.comment-item {
    border-left: 3px solid var(--line);
    padding-left: 1rem;
    margin-bottom: 1rem;
}

.comment-author {
    color: var(--text);
    font-weight: 600;
}

.comment-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.comment-body {
    border-radius: 8px;
    color: var(--text-soft);
    word-break: break-word;
}

.user-comment {
    border-left-color: rgba(255, 255, 255, 0.7);
}

.developer-comment {
    border-left-color: var(--success);
}

.opacity-50 {
    opacity: 0.48 !important;
}

@media (max-width: 1180px) {
    .page {
        padding: 36px 32px;
    }

    .nav-links {
        gap: 18px;
    }

    .support-layout {
        grid-template-columns: 1fr;
    }

    .hero-copy {
        min-height: auto;
        align-content: start;
        padding: 24px 0 0;
    }

    .hero-copy h1 {
        max-width: none;
    }

    .workspace {
        max-width: 900px;
        width: 100%;
    }
}

@media (max-width: 760px) {
    .page {
        gap: 28px;
        padding: 24px 16px 32px;
    }

    .topbar {
        align-items: center;
    }

    .nav-links {
        display: none;
    }

    .lang {
        gap: 8px;
    }

    .hero-copy {
        gap: 18px;
    }

    .hero-copy h1 {
        font-size: 42px;
    }

    .panel-header,
    .panel-body {
        padding: 18px;
    }

    .panel-header {
        display: grid;
    }

    .panel-badge {
        width: fit-content;
    }

    .input-group {
        align-items: stretch;
    }

    #verifyBtn {
        min-width: 100%;
        margin-top: 8px;
        border-radius: var(--radius);
    }

    .input-group > #code {
        border-radius: 0 8px 8px 0;
    }

    #alertContainer {
        top: 12px;
        right: 12px;
        width: calc(100vw - 24px);
    }
}

@media (max-width: 520px) {
    .brand-text strong {
        font-size: 16px;
    }

    .brand-text span {
        font-size: 12px;
    }

    .hero-copy h1 {
        font-size: 38px;
    }

    .ticket-header {
        display: grid;
    }
}
