/* ============================================================
   Account Modal — Logg inn / Opprett konto / Min side
   Standalone, modern modal independent of the purchase popup.
   ============================================================ */

.account-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    backdrop-filter: blur(3px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    z-index: 100000;
    padding: 40px 16px;
    overflow-y: auto;
}

.account-modal-overlay.show {
    display: flex;
    animation: account-fade 0.18s ease;
}

@keyframes account-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.account-modal {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
    width: 100%;
    max-width: 720px;            /* wide popup */
    padding: 36px 40px 32px;
    animation: account-pop 0.2s ease;
}

@keyframes account-pop {
    from { transform: translateY(12px) scale(0.98); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.account-modal-close {
    position: absolute;
    top: 16px;
    right: 18px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.account-modal-close:hover { background: #e5e7eb; color: #111827; }

/* Views */
.account-view { display: none; }
.account-view.active { display: block; }

/* Tabs */
.account-tabs {
    display: flex;
    gap: 8px;
    background: #f3f4f6;
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 26px;
}
.account-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 16px;
    border-radius: 9px;
    font-size: 15px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s;
}
.account-tab.active {
    background: #ffffff;
    color: #111827;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Panes */
.account-pane { display: none; }
.account-pane.active { display: block; }

.account-pane h3,
.account-view h3 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: #111827;
}
.account-sub {
    margin: 0 0 20px;
    color: #6b7280;
    font-size: 14px;
}

/* Fields */
.account-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;   /* two columns */
    gap: 14px 18px;
}
.account-field { display: flex; flex-direction: column; margin-bottom: 14px; }
.account-grid .account-field { margin-bottom: 0; }
.account-col-2 { grid-column: 1 / -1; }

.account-field label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}
.account-field input {
    border: 1px solid #d1d5db;
    border-radius: 9px;
    padding: 11px 13px;
    font-size: 15px;
    color: #111827;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: #fff;
}
.account-field input:focus {
    outline: none;
    border-color: #5fc73e;
    box-shadow: 0 0 0 3px rgba(95, 199, 62, 0.18);
}
.account-field input[readonly] { background: #f9fafb; color: #6b7280; }
.account-hint { font-size: 12px; color: #9ca3af; margin-top: 5px; }

/* Price box */
.account-price {
    margin: 22px 0 4px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 18px;
    background: #f9fafb;
}
.account-price-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #374151;
    padding: 4px 0;
}
.account-price-muted { color: #6b7280; }
.account-price-total {
    border-top: 1px solid #e5e7eb;
    margin-top: 6px;
    padding-top: 10px;
    font-size: 17px;
    font-weight: 700;
    color: #111827;
}

/* Stripe payment element */
.account-pay-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin: 20px 0 8px;
}
#account-payment-element { margin-bottom: 8px; }

/* Buttons */
.account-btn {
    width: 100%;
    border: none;
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.05s, filter 0.15s, background 0.15s;
    margin-top: 20px;
}
.account-btn:active { transform: translateY(1px); }
.account-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.account-btn-primary {
    background: linear-gradient(135deg, #5fc73e 0%, #28a745 100%);
    color: #ffffff;
}
.account-btn-primary:hover:not(:disabled) { filter: brightness(1.05); }
.account-btn-ghost {
    background: #f3f4f6;
    color: #374151;
}
.account-btn-ghost:hover { background: #e5e7eb; }
.account-btn .account-spin { margin-left: 8px; }

/* Switch link / terms */
.account-switch {
    text-align: center;
    margin: 16px 0 0;
    font-size: 14px;
    color: #6b7280;
}
.account-switch a, .account-terms a {
    color: #28a745;
    font-weight: 600;
    text-decoration: none;
}
.account-switch a:hover, .account-terms a:hover { text-decoration: underline; }
.account-terms {
    margin: 12px 0 0;
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
    line-height: 1.5;
}

/* Messages */
.account-error {
    display: none;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 9px;
    padding: 10px 13px;
    font-size: 14px;
    margin-top: 16px;
}
.account-error.show { display: block; }
.account-success {
    display: none;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
    border-radius: 9px;
    padding: 10px 13px;
    font-size: 14px;
    margin-top: 16px;
}
.account-success.show { display: block; }

/* ===================== Min side ===================== */
.account-minside-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 22px;
}
.account-minside-header h3 { margin: 0 0 2px; }
.account-minside-header .account-sub { margin: 0; }

.account-badge {
    font-size: 13px;
    font-weight: 700;
    padding: 7px 13px;
    border-radius: 999px;
    white-space: nowrap;
}
.account-badge.ok   { background: #ecfdf5; color: #047857; }
.account-badge.warn { background: #fff7ed; color: #c2410c; }

.account-minside-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

.account-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 18px;
}
.account-minside-grid .account-card { margin-bottom: 0; }
.account-card h4 {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.account-dl {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 16px;
    font-size: 14px;
}
.account-dl dt { color: #6b7280; }
.account-dl dd { margin: 0; color: #111827; font-weight: 600; word-break: break-word; }

.account-sub-status { font-weight: 700; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.account-sub-status.ok   { color: #047857; }
.account-sub-status.warn { color: #c2410c; }

.account-minside-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}
.account-minside-footer .account-btn { width: auto; margin-top: 0; padding: 11px 22px; }

/* ===================== Success view ===================== */
.account-success-box {
    text-align: center;
    padding: 16px 8px 8px;
}
.account-success-icon {
    font-size: 66px;
    line-height: 1;
    color: #28a745;
    margin-bottom: 16px;
    animation: account-pop 0.25s ease;
}
.account-success-box h3 { margin: 0 0 10px; }
.account-success-text {
    color: #4b5563;
    font-size: 15px;
    line-height: 1.55;
    margin: 0 auto 24px;
    max-width: 420px;
}
.account-success-box .account-btn {
    max-width: 240px;
    margin-left: auto;
    margin-right: auto;
}

/* Responsive */
@media (max-width: 640px) {
    .account-modal { padding: 28px 20px 24px; border-radius: 14px; }
    .account-grid { grid-template-columns: 1fr; }
    .account-minside-grid { grid-template-columns: 1fr; }
}
