.verified-icon {
    position: relative;

    width: 112px;
    height: 112px;

    color: #59d58b;
}

.verified-corner {
    position: absolute;

    width: 31px;
    height: 31px;

    border-color: currentColor;
    border-style: solid;

    opacity: 0;

    animation: verified-frame-in 420ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.verified-corner.top-left {
    top: 0;
    left: 0;
    border-width: 4px 0 0 4px;
    border-radius: 14px 0 0;
}

.verified-corner.top-right {
    top: 0;
    right: 0;
    border-width: 4px 4px 0 0;
    border-radius: 0 14px 0 0;
}

.verified-corner.bottom-left {
    bottom: 0;
    left: 0;
    border-width: 0 0 4px 4px;
    border-radius: 0 0 0 14px;
}

.verified-corner.bottom-right {
    right: 0;
    bottom: 0;
    border-width: 0 4px 4px 0;
    border-radius: 0 0 14px;
}

.verified-scan-line {
    position: absolute;
    top: 18px;
    right: 16px;
    left: 16px;

    height: 2px;

    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 12px currentColor;

    opacity: 0;

    animation: verified-scan 700ms 280ms ease-in-out both;
}

.verified-check {
    position: absolute;
    inset: 20px;

    width: 72px;
    height: 72px;
}

.verified-check use {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 50;
    stroke-dashoffset: 50;

    animation: verified-check-draw 440ms 850ms ease-out forwards;
}

@keyframes verified-content-in {
    from {
        opacity: 0;
        transform: scale(0.97);
    }

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

@keyframes verified-frame-in {
    from {
        opacity: 0;
        transform: scale(0.78);
    }

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

@keyframes verified-scan {
    0% {
        opacity: 0;
        transform: translateY(0);
    }

    18%,
    82% {
        opacity: 0.9;
    }

    100% {
        opacity: 0;
        transform: translateY(74px);
    }
}

@keyframes verified-check-draw {
    to {
        stroke-dashoffset: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .verification-panel.is-verified .verification-success,
    .account-link-success,
    .verified-corner,
    .verified-scan-line,
    .verified-check use {
        animation-duration: 1ms;
        animation-delay: 0ms;
    }
}

/* =============================
   SETTINGS
   ============================= */

.settings-panel {
    padding: 24px;

    border: 1px solid var(--border);

    border-radius: var(--radius-xl);

    background: linear-gradient(145deg, var(--surface-sheen), transparent 45%), var(--surface);

    box-shadow: var(--shadow-soft);
}

.settings-group {
    padding: 26px 0;

    border-bottom: 1px solid var(--border);
}

.settings-group:first-child {
    padding-top: 0;
}

.settings-group:last-child {
    padding-bottom: 0;

    border-bottom: 0;
}

.settings-section-header {
    margin-bottom: 20px;
}

.settings-section-header h3 {
    margin: 0;

    font-size: 17px;
}

.settings-section-header p {
    margin: 6px 0 0;

    color: var(--text-muted);

    font-size: 13px;
}

.account-link-form {
    display: grid;
    gap: 14px;
}

.account-link-form label {
    display: flex;
    flex-direction: column;
    gap: 7px;

    color: var(--text-muted);

    font-size: 12px;
}

.account-link-privacy {
    grid-column: 1 / -1;

    margin: 0;

    color: var(--text-muted);

    font-size: 12px;
    line-height: 1.5;
}

#account-link-submit,
.account-link-open,
.account-link-action {
    width: fit-content;
}

.account-choice {
    width: fit-content;

    padding: 11px 16px;

    border: 1px solid var(--accent);
    border-radius: 10px;

    background: var(--accent);
    color: var(--background);

    font-weight: 700;
    cursor: pointer;
}

#account-link-submit:disabled {
    opacity: 0.6;
}

.account-link-open {
    width: fit-content;
}

.linked-account-list {
    display: grid;
    gap: 10px;

    margin-top: 18px;
}

.linked-account-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    padding: 13px 14px;

    border: 1px solid var(--border);
    border-radius: 11px;

    background: var(--background);
}

.linked-account-info {
    flex: 1;
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 4px;
}

.linked-account-heading {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    align-items: center;
    gap: 64px;
    min-width: 0;
}

.linked-account-discord-access {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

@media (max-width: 600px) {
    .linked-account-heading {
        column-gap: 24px;
    }
}

.linked-account-info .linked-discord-profile {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: 5px;
    white-space: nowrap;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.linked-discord-profile img {
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
}

.linked-account-info .linked-discord-name {
    color: var(--text);
    overflow-wrap: anywhere;
}

.linked-account-info .linked-discord-username {
    color: var(--text);
    opacity: 0.55;
    overflow-wrap: anywhere;
}

.linked-account-info strong {
    overflow: hidden;

    color: var(--text);

    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.linked-account-info span,
.linked-account-empty {
    color: var(--text-muted);

    font-size: 12px;
}

.linked-account-empty {
    margin: 0;
}

.account-danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    margin-top: 24px;
    padding-top: 20px;

    border-top: 1px solid var(--border);
}

.account-danger-zone div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.account-danger-zone strong {
    color: var(--text);

    font-size: 13px;
}

.account-danger-zone span {
    color: var(--text-muted);

    font-size: 11px;
}

#account-manage-status:not(:empty) {
    margin-top: 14px;
}

.settings-modal[hidden] {
    display: none;
}

.settings-modal {
    position: fixed;
    z-index: 1000;
    inset: 0;

    display: grid;
    place-items: center;

    padding: 20px;
}

.settings-modal-backdrop {
    position: absolute;
    inset: 0;

    background: rgba(5, 7, 12, 0.72);
    backdrop-filter: blur(7px);

    animation: settings-backdrop-in 180ms ease-out both;
}

.settings-modal-dialog {
    position: relative;
    z-index: 1;

    width: min(100%, 430px);
    max-height: min(680px, calc(100vh - 40px));
    overflow-y: auto;
    box-sizing: border-box;

    padding: 28px;

    border: 1px solid var(--border);
    border-radius: 16px;

    background: var(--surface);

    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);

    animation: settings-modal-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.settings-modal-dialog h3 {
    margin: 0 36px 6px 0;

    font-size: 21px;
}

.settings-modal-description {
    margin: 0 0 22px;

    color: var(--text-muted);

    font-size: 13px;
}

.settings-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;

    width: 32px;
    height: 32px;

    padding: 0;

    border: 1px solid var(--border);
    border-radius: 50%;

    background: var(--background);
    color: var(--text-muted);

    font-size: 21px;
    line-height: 1;
    cursor: pointer;
}

.settings-modal-open {
    overflow: hidden;
}

.account-link-message.warning {
    padding: 12px 14px;

    border: 1px solid color-mix(in srgb, #f0b35f 45%, var(--border));
    border-radius: 10px;

    background: color-mix(in srgb, #f0b35f 10%, var(--background));
    color: #f0c47f;
}

@keyframes settings-backdrop-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes settings-modal-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.97);
    }

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

.account-link-result:not(:empty) {
    margin-top: 18px;
}

.account-link-message {
    margin: 0;

    color: var(--text-muted);

    line-height: 1.5;
}

.account-link-message.error {
    color: #f08080;
}

.account-link-action {
    display: inline-block;

    margin-top: 12px;
}

.account-choices {
    display: grid;
    gap: 10px;
}

.account-choice {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    border-color: var(--border);

    background: var(--background);
    color: var(--text);

    text-align: left;
}

.account-choice span {
    color: var(--text-muted);

    font-size: 12px;
    font-weight: 400;
}

.account-link-success {
    display: flex;
    min-height: 230px;

    align-items: center;
    justify-content: center;
    flex-direction: column;

    text-align: center;

    animation: verified-content-in 300ms ease-out both;
}

.account-link-success h4 {
    margin: 22px 0 6px;

    color: var(--text);

    font-size: 26px;
}

.account-link-success p {
    margin: 0;

    color: var(--text-muted);
}

.theme-options {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 12px;
}

.theme-option {
    position: relative;

    display: flex;
    align-items: center;

    gap: 14px;

    width: 100%;

    padding: 14px;

    border: 1px solid var(--border);

    border-radius: var(--radius-md);

    background: var(--surface-inset);

    color: var(--text);

    text-align: left;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.theme-option:hover {
    background: var(--surface-hover);

    transform: translateY(-1px);

    box-shadow: 0 12px 28px color-mix(in srgb, var(--background) 36%, transparent);
}

.theme-option.selected {
    border-color: var(--accent);

    background: color-mix(in srgb, var(--accent) 8%, var(--surface-raised));

    box-shadow: 0 0 0 3px var(--accent-soft);
}

.theme-preview {
    width: 46px;
    height: 46px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 13px;

    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.theme-preview span {
    width: 18px;
    height: 18px;

    border-radius: 50%;

    box-shadow: 0 0 18px currentColor;
}

.theme-preview-blue {
    background: linear-gradient(145deg, #182038, #0b0e17);
    color: #8f9cff;
}

.theme-preview-blue span {
    background: #8f9cff;
}

.theme-preview-pink {
    background: linear-gradient(145deg, #342035, #120c13);
    color: #e889b5;
}

.theme-preview-pink span {
    background: #e889b5;
}

.theme-preview-light-blue {
    background: linear-gradient(145deg, #ffffff, #dfe5f5);
    color: #6675e8;
}

.theme-preview-light-blue span {
    background: #6675e8;
}

.theme-preview-light-pink {
    background: linear-gradient(145deg, #ffffff, #f1dfe9);
    color: #d7659b;
}

.theme-preview-light-pink span {
    background: #d7659b;
}

.theme-option-info {
    display: flex;
    flex-direction: column;

    gap: 4px;
}

.theme-option-info strong {
    font-size: 14px;
}

.theme-option-info span {
    color: var(--text-muted);

    font-size: 12px;
}

.theme-check {
    margin-left: auto;

    width: 22px;
    height: 22px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: var(--accent);

    opacity: 0;

    transform: scale(0.8);

    transition:
        opacity 0.2s ease,
        transform 0.2s ease;

    -webkit-mask: none;
    mask: none;
}

.theme-check::after {
    content: "";

    width: 18px;
    height: 18px;

    background: var(--background);

    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Cpath fill='none' stroke='black' stroke-width='4' stroke-linecap='round' stroke-linejoin='round' d='M6.5 14.2L11.8 19.2L21.5 8.8'/%3E%3C/svg%3E")
        center / 18px 18px no-repeat;

    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Cpath fill='none' stroke='black' stroke-width='4' stroke-linecap='round' stroke-linejoin='round' d='M6.5 14.2L11.8 19.2L21.5 8.8'/%3E%3C/svg%3E")
        center / 18px 18px no-repeat;
}

.theme-option.selected .theme-check {
    opacity: 1;

    transform: scale(1);
}

/* =============================
   ANIMATIONS SETTING
   ============================= */

.settings-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 14px;

    border: 1px solid var(--border);

    border-radius: 12px;

    background: var(--background);
}

.settings-toggle + .settings-toggle {
    margin-top: 10px;
}

.settings-toggle-info {
    display: flex;
    flex-direction: column;

    gap: 4px;

    min-width: 0;
}

.settings-toggle-info strong {
    font-size: 14px;
}

.settings-toggle-info span {
    color: var(--text-muted);

    font-size: 12px;
}

/* ---------------------------------------------------------
   Toggle
   --------------------------------------------------------- */

.settings-toggle-switch {
    position: relative;

    width: 46px;
    height: 26px;

    flex-shrink: 0;

    padding: 0;

    border: 1px solid var(--border);

    border-radius: 999px;

    background: var(--surface-hover);

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

.settings-toggle-switch::after {
    content: "";

    position: absolute;

    top: 3px;
    left: 3px;

    width: 18px;
    height: 18px;

    border-radius: 50%;

    background: var(--text-muted);

    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);

    transition:
        transform 0.2s ease,
        background 0.2s ease;
}

/* ---------------------------------------------------------
   Enabled
   --------------------------------------------------------- */

.settings-toggle-switch.active {
    border-color: var(--accent);

    background: color-mix(in srgb, var(--accent) 18%, var(--surface));
}

.settings-toggle-switch.active::after {
    background: var(--accent);

    transform: translateX(20px);
}

/* ---------------------------------------------------------
   Hover / Focus
   --------------------------------------------------------- */

.settings-toggle-switch:hover {
    border-color: var(--accent);
}

.settings-toggle-switch:focus-visible {
    outline: none;

    box-shadow: none;
}

/* ---------------------------------------------------------
   Mobile
   --------------------------------------------------------- */

@media (max-width: 650px) {
    .account-link-form {
        grid-template-columns: 1fr;
    }

    .settings-toggle {
        padding: 13px;
    }

    .settings-toggle-switch {
        width: 44px;
        height: 25px;
    }

    .settings-toggle-switch::after {
        width: 17px;
        height: 17px;
    }

    .settings-toggle-switch.active::after {
        transform: translateX(19px);
    }
}

#account-link-submit,
.account-link-open,
.account-link-action {
    padding: 11px 16px;
}
