.account-page {
    min-height: 100vh;
    padding: 150px 0 80px;
}

.account-heading {
    max-width: 700px;
    margin-bottom: 34px;
}

.account-eyebrow {
    display: inline-flex;
    margin-bottom: 12px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    opacity: 0.7;
}

.account-heading h1 {
    margin: 0 0 10px;
    font-size: clamp(2rem, 5vw, 3.4rem);
}

.account-heading p {
    margin: 0;
    opacity: 0.7;
    line-height: 1.8;
}

.account-card,
.account-login-required,
.account-error,
.account-loading {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.035);
}

.account-loading,
.account-login-required,
.account-error {
    padding: 35px;
}

.account-card {
    padding: 28px;
}

.account-card[hidden],
.account-loading[hidden],
.account-login-required[hidden],
.account-error[hidden] {
    display: none !important;
}

.account-profile {
    display: flex;
    align-items: center;
    gap: 18px;
    padding-bottom: 25px;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.account-avatar-wrap {
    flex: 0 0 auto;
}

.account-avatar {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.12);
}

.account-profile-text h2 {
    margin: 0 0 7px;
    font-size: 1.5rem;
}

.account-connected {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    background: rgba(87, 242, 135, 0.1);
    border: 1px solid rgba(87, 242, 135, 0.2);
}

.account-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.account-info-item {
    min-width: 0;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.12);
}

.account-info-item span {
    display: block;
    margin-bottom: 7px;
    font-size: 0.8rem;
    opacity: 0.6;
}

.account-info-item strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: 0.96rem;
}

.account-future {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 26px;
}

.future-box {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 20px;
    border-radius: 16px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
}

.future-box > span {
    font-size: 1.5rem;
}

.future-box strong {
    display: block;
    margin-bottom: 5px;
}

.future-box p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.6;
    opacity: 0.55;
}

.account-login-required h2,
.account-error h2 {
    margin-top: 0;
}

.account-login-required p,
.account-error p {
    opacity: 0.7;
    margin-bottom: 22px;
}

.account-nav-links .active {
    font-weight: 800;
}

@media (max-width: 800px) {
    .account-page {
        padding-top: 120px;
    }

    .account-info-grid,
    .account-future {
        grid-template-columns: 1fr;
    }

    .account-nav-links {
        display: none;
    }

    .account-card {
        padding: 20px;
    }
}

/* Keep technical account values readable in RTL */
#accountUsername,
#accountDiscordId,
#accountEmail {
    direction: ltr;
    unicode-bidi: isolate;
    text-align: left;
}

html[dir="rtl"] #accountUsername,
html[dir="rtl"] #accountDiscordId,
html[dir="rtl"] #accountEmail {
    text-align: right;
}


.account-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.account-logout-button {
    appearance: none;
    border: 1px solid rgba(255, 90, 90, 0.24);
    border-radius: 12px;
    padding: 11px 17px;
    background: rgba(255, 90, 90, 0.06);
    color: inherit;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.account-logout-button:hover {
    background: rgba(255, 90, 90, 0.11);
}

.account-logout-button:disabled {
    opacity: 0.55;
    cursor: wait;
}


.orders-box {
    align-items: flex-start;
}

.orders-box-content {
    width: 100%;
    min-width: 0;
}

.orders-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.orders-empty {
    margin: 0;
    opacity: 0.55;
    font-size: 0.85rem;
}

.order-item {
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 13px;
    background: rgba(0, 0, 0, 0.12);
}

.order-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.order-item-header strong {
    overflow-wrap: anywhere;
}

.order-status {
    flex: 0 0 auto;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.order-status-pending .order-status {
    background: rgba(255, 193, 7, 0.08);
}

.order-status-paid .order-status {
    background: rgba(87, 242, 135, 0.08);
}

.order-status-failed .order-status,
.order-status-cancelled .order-status {
    background: rgba(255, 90, 90, 0.08);
}

.order-details {
    display: grid;
    gap: 5px;
    font-size: 0.78rem;
    opacity: 0.65;
}

.order-details span {
    overflow-wrap: anywhere;
}

/* ===== ORDER GUILD SELECTOR ===== */

.order-guild-selector {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,.08);
    display: grid;
    gap: 9px;
}

.order-guild-selector label {
    font-weight: 700;
    font-size: .92rem;
}

.order-guild-select {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 10px;
    padding: 0 12px;
    background: #10131a;
    color: #fff;
    outline: none;
}

.order-guild-select:focus {
    border-color: rgba(255,255,255,.32);
}

.order-guild-save {
    min-height: 42px;
    border: 0;
    border-radius: 10px;
    padding: 0 16px;
    cursor: pointer;
    font-weight: 700;
}

.order-guild-save:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.order-guild-message {
    min-height: 20px;
    font-size: .88rem;
}

.order-guild-message.success {
    color: #8ee6a6;
}

.order-guild-message.error {
    color: #ff9d9d;
}


/* ===== ORDER BOT INVITE ===== */

.order-bot-invite {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,.08);
    display: grid;
    gap: 9px;
}

.order-bot-invite-button {
    min-height: 42px;
    border: 0;
    border-radius: 10px;
    padding: 0 16px;
    cursor: pointer;
    font-weight: 700;
}

.order-bot-invite-button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.order-bot-invite-message {
    min-height: 20px;
    font-size: .88rem;
}

.order-bot-invite-message.error {
    color: #ff9d9d;
}

/* ===== SUBSCRIPTIONS ===== */

.subscriptions-box {
    align-items: flex-start;
}

.subscriptions-box-content {
    width: 100%;
    min-width: 0;
}

.subscriptions-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.subscriptions-empty {
    margin: 0;
    opacity: 0.55;
    font-size: 0.85rem;
}

.subscription-item {
    padding: 14px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 13px;
    background: rgba(0,0,0,.12);
}

.subscription-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.subscription-item-header strong {
    overflow-wrap: anywhere;
}

.subscription-status {
    flex: 0 0 auto;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    border: 1px solid rgba(255,255,255,.1);
}

.subscription-status-active .subscription-status {
    background: rgba(87,242,135,.08);
}

.subscription-status-expired .subscription-status {
    background: rgba(255,90,90,.08);
}

.subscription-status-suspended .subscription-status {
    background: rgba(255,193,7,.08);
}

.subscription-details {
    display: grid;
    gap: 5px;
    font-size: 0.78rem;
    opacity: 0.65;
}

.subscription-details span {
    overflow-wrap: anywhere;
}

.subscription-message {
    margin-top: 12px;
    font-size: 0.85rem;
}

.subscription-message.error {
    color: #ff9d9d;
}


/* ===== SUBSCRIPTION RENEW ===== */

.subscription-renew {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

.subscription-renew-button {
    min-height: 42px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 10px;
    padding: 0 16px;
    cursor: pointer;
    font-weight: 700;
    background: rgba(255,255,255,.06);
    color: inherit;
}

.subscription-renew-button:hover {
    background: rgba(255,255,255,.1);
}

.subscription-renew-button:disabled {
    opacity: .55;
    cursor: wait;
}

.subscription-renew-message {
    min-height: 20px;
    font-size: .88rem;
}

.subscription-renew-message.error {
    color: #ff9d9d;
}



/* ===== DISCORD ACCOUNT LINK ===== */

.account-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.account-discord-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 20px;
    border: 1px solid rgba(88, 101, 242, 0.55);
    border-radius: 12px;
    background: rgba(88, 101, 242, 0.14);
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition:
        transform .18s ease,
        background .18s ease,
        border-color .18s ease;
}

.account-discord-link-button:hover {
    transform: translateY(-1px);
    background: rgba(88, 101, 242, 0.23);
    border-color: rgba(88, 101, 242, 0.8);
}

.account-discord-link-button[hidden] {
    display: none;
}

@media (max-width: 560px) {
    .account-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .account-discord-link-button,
    .account-logout-button {
        width: 100%;
        box-sizing: border-box;
    }
}


/* ===== EMAIL-ONLY SUBSCRIPTION NOTICE ===== */

.subscriptions-discord-required {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
}

.subscriptions-discord-required .subscriptions-empty {
    margin: 0;
}


.order-fulfillment-message {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.7;
    opacity: 0.9;
}


/* ===== DIGITAL DELIVERY ===== */

.order-digital-delivery {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,.08);
    display: grid;
    gap: 9px;
}

.order-digital-delivery-message {
    min-height: 20px;
    font-size: .88rem;
}

.order-digital-delivery-message.error {
    color: #ff9d9d;
}

.order-digital-delivery-result[hidden] {
    display: none !important;
}

.order-digital-delivery-result {
    display: grid;
    gap: 9px;
}

.order-digital-value {
    padding: 11px 12px;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 10px;
    background: rgba(0,0,0,.18);
    overflow-wrap: anywhere;
    direction: ltr;
    text-align: left;
    font-family: monospace;
}

.order-digital-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.order-digital-small-button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9px;
    padding: 0 14px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
}


.account-withdrawal-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 16px;
    border: 1px solid rgba(255, 200, 90, 0.28);
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}

.account-withdrawal-button:hover {
    border-color: rgba(255, 200, 90, 0.55);
}

@media (max-width: 640px) {
    .account-withdrawal-button {
        width: 100%;
        box-sizing: border-box;
    }
}


.order-withdrawal-action {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.order-withdrawal-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 11px;
    border: 1px solid rgba(255, 200, 90, 0.25);
    border-radius: 9px;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 700;
}

.order-withdrawal-link:hover {
    border-color: rgba(255, 200, 90, 0.55);
}

@media (max-width: 640px) {
    .order-withdrawal-link {
        width: 100%;
        box-sizing: border-box;
    }
}
