/* ════════════════════════════════════════════════════════════
   INNLOGGING & REGISTRERING — FINAL VERSION
   ════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────
   MODAL FOUNDATION
   ────────────────────────────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    background: rgba(5, 10, 18, 0.92);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.25s ease-out;
}

.modal.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-content {
    background: linear-gradient(145deg, #152939 0%, #0E2333 100%);
    border: 1px solid rgba(192, 192, 192, 0.12);
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    max-width: 440px;
    width: 100%;
    position: relative;
    animation: slideUp 0.3s ease-out;
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-register {
    max-width: 680px !important;
}

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

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(192, 192, 192, 0.15);
    border-radius: 8px;
    color: #9A9A9A;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(192, 192, 192, 0.3);
    color: #D4D4D4;
}

.modal-title {
    font-size: 1.75rem;
    font-weight: 300;
    color: #FFFFFF;
    margin: 2rem 2rem 0.5rem 2rem;
    letter-spacing: -0.01em;
}

.register-description {
    color: #B8B8B8;
    font-size: 0.95rem;
    margin: 0 2rem 0 2rem;
}

/* ──────────────────────────────────────────────────────────
   PROGRESS INDICATOR
   ────────────────────────────────────────────────────────── */
.form-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.25rem 2rem 1rem;
    background: rgba(11, 28, 45, 0.3);
    border-bottom: 1px solid rgba(192, 192, 192, 0.06);
    flex-shrink: 0;
    /* Flytt progress ut av form-flow så den alltid vises øverst */
    order: -1;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    max-width: 90px;
}

.progress-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(192, 192, 192, 0.1);
    border: 2px solid rgba(192, 192, 192, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6B7280;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.progress-step.active .progress-circle {
    background: linear-gradient(135deg, #B8B8B8, #D4D4D4);
    border-color: #D4D4D4;
    color: #0B1C2D;
    box-shadow: 0 4px 12px rgba(184, 184, 184, 0.3);
}

.progress-step.completed .progress-circle {
    background: #22c55e;
    border-color: #22c55e;
    color: #FFFFFF;
}

.progress-step span {
    font-size: 0.7rem;
    color: #6B7280;
    transition: color 0.3s;
    text-align: center;
}

.progress-step.active span {
    color: #D4D4D4;
    font-weight: 500;
}

.progress-line {
    width: 40px;
    height: 2px;
    background: rgba(192, 192, 192, 0.15);
    margin-bottom: 1.75rem;
    flex-shrink: 0;
}

/* ──────────────────────────────────────────────────────────
   FORM CONTAINER
   ────────────────────────────────────────────────────────── */
.login-form,
.register-form {
    padding: 1.5rem 2rem 2rem;
    overflow-y: auto;
    flex: 1;
    /* Flexbox slik at form-progress kan sorteres øverst */
    display: flex;
    flex-direction: column;
}

/* ──────────────────────────────────────────────────────────
   FORM STEPS — KRITISK: kun aktivt steg vises
   ────────────────────────────────────────────────────────── */
.form-step {
    display: none !important;
    animation: fadeInStep 0.3s ease-out;
}

.form-step.active {
    display: flex !important;
    flex-direction: column;
}

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

.step-title {
    font-size: 1.15rem;
    font-weight: 500;
    color: #FFFFFF;
    margin: 0 0 1.25rem 0;
}

/* ──────────────────────────────────────────────────────────
   FORM ELEMENTS
   ────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    color: #D4D4D4;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"],
.form-group input[type="tel"] {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(11, 28, 45, 0.6);
    border: 1px solid rgba(192, 192, 192, 0.2);
    border-radius: 10px;
    color: #FFFFFF;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #B8B8B8;
    box-shadow: 0 0 0 3px rgba(184, 184, 184, 0.1);
    background: rgba(11, 28, 45, 0.8);
}

.form-group input::placeholder {
    color: #6B7280;
}

/* Password */
.password-input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #6B7280;
    cursor: pointer;
    padding: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.password-toggle:hover { color: #D4D4D4; }
.password-toggle svg { width: 18px; height: 18px; }

.password-strength {
    font-size: 0.8rem;
    margin-top: 0.4rem;
    min-height: 1.2em;
}

.form-message {
    font-size: 0.8rem;
    margin-top: 0.4rem;
    min-height: 1.2em;
}

/* ──────────────────────────────────────────────────────────
   BUTTONS
   ────────────────────────────────────────────────────────── */
.btn-primary,
.btn-secondary,
.btn-block,
.btn-next,
.btn-back,
.btn-submit {
    font-family: inherit;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
    padding: 0.875rem 1.5rem;
    white-space: nowrap;
}

.btn-primary,
.btn-block,
.btn-next,
.btn-submit {
    background: linear-gradient(135deg, #B8B8B8 0%, #D4D4D4 100%);
    color: #0B1C2D;
    border: none;
}

.btn-primary:hover,
.btn-block:hover,
.btn-next:hover,
.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(184, 184, 184, 0.3);
}

.btn-primary:disabled,
.btn-next:disabled,
.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-block {
    width: 100%;
    margin-top: 0.5rem;
}

.btn-secondary,
.btn-back {
    background: transparent;
    border: 1px solid rgba(192, 192, 192, 0.25);
    color: #D4D4D4;
}

.btn-secondary:hover,
.btn-back:hover {
    background: rgba(192, 192, 192, 0.05);
    border-color: rgba(192, 192, 192, 0.4);
}

.btn-next svg,
.btn-back svg,
.btn-submit svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Knapp-rad — alltid nederst i steget */
.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1.5rem;
}

.form-actions button {
    flex: 1;
}

/* Enkeltknapp (steg 1 har bare «Neste») */
.form-step .btn-next:only-child,
.form-step > .btn-next {
    width: 100%;
    margin-top: auto;
}

/* ──────────────────────────────────────────────────────────
   PRICING CARDS — STEG 3
   ────────────────────────────────────────────────────────── */
.reg-pricing-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.reg-pricing-card {
    display: block;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 1.25rem;
    transition: border-color 0.2s, background 0.2s;
    background: rgba(11,28,45,0.4);
    position: relative;
    user-select: none;
}

.reg-pricing-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.reg-pricing-card:hover {
    border-color: rgba(255,255,255,0.3);
    background: rgba(11,28,45,0.6);
}

.reg-pricing-card.selected,
.reg-pricing-card input[type="radio"]:checked ~ .reg-pricing-inner {
    border-color: #B8B8B8;
}

.reg-pricing-card.selected {
    border-color: #B8B8B8;
    background: rgba(184,184,184,0.08);
    box-shadow: 0 4px 16px rgba(184,184,184,0.12);
}

.reg-pricing-card-recommended {
    border-color: rgba(184,184,110,0.35);
}

.reg-pricing-badge {
    display: inline-block;
    background: linear-gradient(135deg, #B8B8B8, #D4D4D4);
    color: #0B1C2D;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.reg-pricing-header h4 {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    color: #fff;
    font-weight: 500;
}

.reg-pricing-price {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-bottom: 0.2rem;
}

.reg-price-amount {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
}

.reg-price-currency {
    font-size: 0.875rem;
    color: #9A9A9A;
}

.reg-pricing-savings {
    font-size: 0.8rem;
    color: #22c55e;
    margin-bottom: 0.75rem;
}

.reg-pricing-features {
    list-style: none;
    padding: 0;
    margin: 0.6rem 0 0;
}

.reg-pricing-features li {
    font-size: 0.84rem;
    color: #B8B8B8;
    padding: 0.2rem 0;
    line-height: 1.4;
}

/* ──────────────────────────────────────────────────────────
   CHECKBOX & FOOTER
   ────────────────────────────────────────────────────────── */
.checkbox-group {
    margin-bottom: 0 !important;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: #B8B8B8;
    font-size: 0.875rem;
    line-height: 1.5;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0.125rem 0 0;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #B8B8B8;
}

.checkbox-label a {
    color: #D4D4D4;
    text-decoration: underline;
}

.checkbox-label a:hover { color: #FFFFFF; }

.form-footer,
.register-footer {
    text-align: center;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(192, 192, 192, 0.08);
    color: #9A9A9A;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.form-footer .link,
.register-footer a {
    color: #D4D4D4;
    text-decoration: none;
    font-weight: 500;
}

.form-footer .link:hover,
.register-footer a:hover { color: #FFFFFF; }

/* ──────────────────────────────────────────────────────────
   SUCCESS MODAL
   ────────────────────────────────────────────────────────── */
.modal-icon.success {
    width: 64px;
    height: 64px;
    background: rgba(34,197,94,0.15);
    border: 2px solid #22c55e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem auto 1rem;
    color: #22c55e;
}

.modal-icon.success svg {
    width: 32px;
    height: 32px;
}

/* ──────────────────────────────────────────────────────────
   RESPONSIV — MOBIL
   ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .modal-content {
        max-width: 100%;
        max-height: 95vh;
    }

    .modal-register { max-width: 100% !important; }

    .modal-title { font-size: 1.4rem; margin: 1.5rem 1.5rem 0.4rem; }
    .register-description { margin: 0 1.5rem; }

    .login-form,
    .register-form { padding: 1.25rem 1.5rem 1.5rem; }

    .form-progress {
        padding: 1rem 1.5rem 0.75rem;
        gap: 0.5rem;
    }

    .progress-circle { width: 34px; height: 34px; font-size: 0.85rem; }
    .progress-line { width: 20px; }
    .progress-step span { font-size: 0.65rem; }
    .progress-step { max-width: 70px; }

    .reg-pricing-options { grid-template-columns: 1fr; }

    .form-actions { flex-direction: column; }
    .form-actions button { width: 100%; }
}
