/**
 * Frontend Styles for 433-medlemskap Plugin v3.0 (Dashboard Focused)
 * This stylesheet replaces all previous styling.
 */

/* --- Globale og generelle stiler --- */
body.page-template-page-433-fullbredde {
    background-color: #f4f7f9;
    overflow-x: hidden;
}
.page-template-page-433-fullbredde .entry-title {
    display: none;
}
.f433-full-width-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

/* --- Meldinger (Suksess/Feil) --- */
.f433-error-message, .f433-success-message {
    padding: 1em 1.5em;
    margin-bottom: 2em;
    border-radius: 8px;
    border: 1px solid;
}
.f433-error-message { background-color: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.f433-success-message { background-color: #d4edda; color: #155724; border-color: #c3e6cb; }

/* --- Knapper (Samlet struktur for konsistens) --- */
.f433-button-primary, .f433-button-secondary, .f433-button-danger, .f433-google-login-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    box-sizing: border-box;
    transition: all 0.2s ease-in-out;
}
.f433-button-primary { background-color: #0a0a0a; color: #fff; }
.f433-button-primary:hover { background-color: #333; }
.f433-button-primary:disabled { background: #999; cursor: not-allowed; }
.f433-button-secondary { background-color: #f0f0f0; color: #333; border-color: #ddd; }
.f433-button-secondary:hover { background-color: #e0e0e0; }
.f433-button-danger { background-color: #d9534f; color: #fff; border-color: #d43f3a; }
.f433-button-danger:hover { background-color: #c9302c; }
.f433-google-login-button { background-color: #fff; color: #444; border-color: #ccc; }
.f433-google-login-button:hover { background-color: #f8f8f8; border-color: #bbb; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.f433-google-login-button img { width: 20px; height: 20px; margin-right: 12px; }

/* --- Innlogging/Registrering (Auth Form) --- */
.f433-auth-wrapper {
    display: grid;
    align-items: center;
    max-width: 900px;
    margin: 2em auto;
    padding: 0 15px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}
.f433-promo-column { display: none; }
.f433-form-column { padding: 2.5em 1.5em; box-sizing: border-box; }
@media(min-width: 820px) {
    .f433-auth-wrapper { grid-template-columns: 1fr 1fr; background: none; box-shadow: none; margin: 5em auto; padding: 0; }
    .f433-promo-column, .f433-form-column { grid-row: 1 / 2; }
    .f433-promo-column { display: block; grid-column: 1 / 2; background-color: #0056b3; color: #fff; padding: 2em; border-radius: 10px; text-align: center; width: 85%; height: 75%; box-shadow: 0 20px 50px -10px rgba(0, 86, 179, .4); z-index: 1; position: relative; transform: translateX(-5%); }
    .f433-form-column { padding: 4em 2.5em; grid-column: 2 / 3; margin-left: 50px; border-radius: 40px; box-shadow: 0 15px 45px rgba(0, 4, 40, .15); transform: translateX(-20%); z-index: 2; background-color: #fff; }
}
.f433-promo-content h2 { color: #fff; font-size: 1.6em; font-weight: 700; margin-bottom: 0.5em; }
.f433-promo-content p { font-size: 1em; opacity: 0.9; line-height: 1.6; }
.f433-promo-image { max-width: 300px; width: 85%; margin: 1.5em auto -4em; filter: drop-shadow(0 10px 20px rgba(0,0,0,0.25)); transform: scale(1.1) rotate(-4deg); transition: transform 0.3s ease-in-out; }
.f433-promo-column:hover .f433-promo-image { transform: scale(1.15) rotate(-2deg); }
.f433-form-container { width: 100%; max-width: 380px; margin: 0 auto; }
.f433-logo-wrapper { text-align: center; margin-bottom: 1.5em; }
.f433-logo { width: 70px; height: 70px; border-radius: 50%; object-fit: cover; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.f433-form-container h3 { text-align: center; font-size: 1.6em; margin-bottom: 0.2em; color: #111; }
.f433-form-container p { text-align: center; margin-bottom: 2em; color: #666; }
#f433-form-subtitle { min-height: 40px; }
.f433-form-container .form-row { margin-bottom: 1em; }
.f433-form-container label { display: block; font-weight: bold; margin-bottom: 8px; font-size: 0.9em; }
.f433-form-container input[type="text"], .f433-form-container input[type="email"], .f433-form-container input[type="password"] { width: 100%; padding: 14px; border: 1px solid #ccc; border-radius: 8px; box-sizing: border-box; font-size: 1em; }
.f433-form-container input:focus { border-color: #0056b3; outline: none; box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.15); }
.form-step { display: none; }
.form-step.active { display: block; }
.f433-social-login-divider { text-align: center; margin: 1.5em 0; font-size: 0.9em; color: #999; display: flex; align-items: center; }
.f433-social-login-divider::before, .f433-social-login-divider::after { content: ''; flex: 1; border-bottom: 1px solid #eee; }
.f433-social-login-divider::before { margin-right: 0.5em; }
.f433-social-login-divider::after { margin-left: 0.5em; }

/* --- NYTT DESIGN: Min Side (Dashboard) --- */

.f4-dashboard {
    font-family: 'Geist', sans-serif;
    max-width: 800px;
    margin: 2rem auto;
    padding: 1rem;
    color: #111;
}

/* Varsler (suksess/feil) */
.f4-dashboard__alert {
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    border: 1px solid;
}
.f4-dashboard__alert p {
    margin: 0;
    font-weight: 500;
}
.f4-dashboard__alert--success {
    background-color: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}
.f4-dashboard__alert--error {
    background-color: #f8d7da;
    border-color: #f5c2c7;
    color: #842029;
}

/* Header */
.f4-dashboard__header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.f4-dashboard__avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.f4-dashboard__user-info h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}
.f4-dashboard__user-info p {
    margin: 0;
    color: #6c757d;
    font-size: 1rem;
}

/* Kort-styling */
.f4-dashboard__card {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.03);
}

/* CTA-kort for gratisbrukere */
.f4-dashboard__card--cta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background-color: #0d1365;
    color: #fff;
    border: none;
}
.f4-dashboard__card--cta h2 {
    color: #fff;
    margin: 0 0 0.25rem;
    font-size: 1.25rem;
}
.f4-dashboard__card--cta p {
    color: #e9ecef;
    margin: 0;
    font-size: 0.95rem;
}
.f4-dashboard__card-icon {
    flex-shrink: 0;
    background-color: rgba(255,255,255,0.1);
    padding: 0.75rem;
    border-radius: 50%;
    color: #fff;
}
.f4-dashboard__card-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}
.f4-dashboard__card--cta .f4-dashboard__button {
    margin-left: auto;
    flex-shrink: 0;
}

/* Medlemskapskort */
.f4-dashboard__membership-status p {
    margin: 0 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.f4-dashboard__tag {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.85em;
    font-weight: 700;
    border-radius: 20px;
}
.f4-dashboard__tag--pluss {
    background-color: #e6f7ff;
    color: #0d1365;
}
.f4-dashboard__tag--gratis {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}
.f4-dashboard__meta-text {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 1rem !important;
}

/* Innstillinger med faner */
.f4-dashboard__tabs {
    display: flex;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 1.5rem;
}
.f4-dashboard__tab-button {
    font-family: 'Geist', sans-serif;
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
}
.f4-dashboard__tab-button.active {
    color: #0d1365;
    border-bottom-color: #0d1365;
}
.f4-dashboard__tab-content {
    display: none;
}
.f4-dashboard__tab-content.active {
    display: block;
}

/* Generelle knapper og skjema-elementer */
.f4-dashboard__form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.f4-dashboard__form-group {
    display: flex;
    flex-direction: column;
}
.f4-dashboard__form-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}
.f4-dashboard__form-group input[type="text"],
.f4-dashboard__form-group input[type="password"] {
    font-family: 'Geist', sans-serif;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 1rem;
}
.f4-dashboard__button {
    font-family: 'Geist', sans-serif;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border: 1px solid transparent;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease-in-out;
}
.f4-dashboard__button--primary {
    background-color: #0d1365;
    color: #fff;
    border-color: #0d1365;
}
.f4-dashboard__button--primary:hover {
    background-color: #000;
    border-color: #000;
}
.f4-dashboard__button--secondary {
    background-color: #f8f9fa;
    color: #343a40;
    border-color: #dee2e6;
}
.f4-dashboard__button--secondary:hover {
    background-color: #e9ecef;
}
.f4-dashboard__button--danger {
    background-color: transparent;
    color: #dc3545;
    border-color: #dc3545;
}
.f4-dashboard__button--danger:hover {
    background-color: #dc3545;
    color: #fff;
}

/* Diverse */
.f4-dashboard__divider {
    border: none;
    border-top: 1px solid #e9ecef;
    margin: 1.5rem 0;
}
.f4-dashboard__footer {
    text-align: center;
    margin-top: 2rem;
}
.f4-dashboard__logout-link {
    color: #6c757d;
    text-decoration: none;
    font-weight: 500;
}
.f4-dashboard__logout-link:hover {
    color: #0d1365;
}

/* --- Tillegg for Abonnement-fane på Min Side --- */

.f4-dashboard__history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.f4-dashboard__history-table th,
.f4-dashboard__history-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.f4-dashboard__history-table th {
    font-weight: 500;
    color: #6c757d;
}

.f4-dashboard__history-table a {
    color: #0d1365;
    text-decoration: none;
    font-weight: 500;
}

.f4-dashboard__history-table a:hover {
    text-decoration: underline;
}

.f4-dashboard__tag--success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.f4-dashboard__tag--error {
    background-color: #f8d7da;
    color: #842029;
}


/* Responsivitet */
@media (max-width: 600px) {
    .f4-dashboard__card--cta {
        flex-direction: column;
        text-align: center;
    }
    .f4-dashboard__card--cta .f4-dashboard__button {
        margin-left: 0;
        width: 100%;
    }
    .f4-dashboard__header {
        flex-direction: column;
        text-align: center;
    }
}


/* --- FIKSET & OPPGRADERT: Betalingsmur Design v5 (433.no) --- */

.f433-paywall-v3-wrapper {
    position: relative;
    /* Setter en minimumshøyde for å sikre at det er plass til betalingsmuren, 
       selv om første avsnitt er veldig kort. */
    min-height: 100px; 
    padding-bottom: 500px; /* Lager plass i bunnen av wrapperen for overlayen */
    margin-bottom: 2em; /* Standard bunn-margin for artikler */
}

.f433-paywall-v3-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 500px; /* Høyden på selve fade-området og boksen */
    
    /* Gradient som fader fra gjennomsiktig til en solid hvitfarge.
       Dette er trikset som skjuler teksten elegant. */
    background: #fff;
    
    /* Posisjonerer innholdet (boksen) i bunnen av dette området */
    display: flex;
    align-items: flex-end;
    justify-content: center;
    box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
}

.f433-paywall-v3-box {
    font-family: 'Geist', sans-serif;
    width: 100%;
    max-width: 500px;
    text-align: center;
    color: #000;
    /* Fjerner unødvendig padding som kan forstyrre posisjoneringen */
    padding: 0 1rem 1rem 1rem; 
}

.f433-paywall-v3-logo {
    display: block;
    width: 80px;
    height: 80px;
    border-radius: 9999px;
    margin: 0 auto 1.5rem;
    border: 3px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1), 0 0 0 4px #0d1365;
}

.f433-paywall-v3-box h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.f433-paywall-v3-box p {
    font-size: 1rem;
    color: #4a4a4a;
    margin: 0 0 2rem;
    max-width: 350px;
    margin-left: auto;
    margin-right: auto;
}

.f433-paywall-v3-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.f433-paywall-v3-button-primary {
    display: inline-block;
    font-family: 'Geist', sans-serif;
    background-color: #0d1365;
    color: #fff;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    border: 2px solid #0d1365;
    transition: all 0.2s ease-in-out;
}

.f433-paywall-v3-button-primary:hover {
    background-color: #000;
    border-color: #000;
    color: #fff;
}

.f433-paywall-v3-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #9ca3af;
    font-size: 0.875rem;
}

.f433-paywall-v3-divider::before,
.f433-paywall-v3-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}

.f433-paywall-v3-divider span {
    padding: 0 0.5rem;
}

.f433-paywall-v3-google-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-family: 'Geist', sans-serif;
    background-color: #fff;
    color: #333;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    border: 1px solid #d1d5db;
    transition: all 0.2s ease-in-out;
}

.f433-paywall-v3-google-button:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

.f433-google-icon {
    width: 20px;
    height: 20px;
}

/* --- Tillegg for infolenke i betalingsmur --- */

.f433-paywall-v3-info-link {
    display: inline-block;
    margin-top: 1.5rem;
    font-family: 'Geist', sans-serif;
    color: #0d1365;
    text-decoration: underline;
    background: none;
    border: none;
    padding: 0;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.f433-paywall-v3-info-link:hover {
    color: #000;
}


/* --- NYTT DESIGN: Velg Medlemskap (Pricing Page) --- */

.f4-pricing-wrapper {
    font-family: 'Geist', sans-serif;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 800px;
    margin: 2rem auto;
    padding: 1rem;
}

@media (min-width: 768px) {
    .f4-pricing-wrapper {
        grid-template-columns: 1fr 1fr;
        align-items: center;
    }
}

.f4-pricing-card {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    text-align: center;
    transition: all 0.3s ease;
}

.f4-pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.f4-pricing-card--popular {
    border: 2px solid #1c1c78;
    background-color: #f8f9fe;
    transform: scale(1.05);
    position: relative;
}

.f4-pricing-card__popular-tag {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ffc95a;
    color: #1c1c78;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.f4-pricing-card__title {
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0 0 0.5rem;
}

.f4-pricing-card__price {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1c1c78;
    margin-bottom: 0.5rem;
}

.f4-pricing-card__original-price {
    text-decoration: line-through;
    color: #adb5bd;
    font-size: 1.5rem;
    font-weight: 400;
    margin-right: 0.5rem;
}

.f4-pricing-card__period {
    font-size: 1rem;
    font-weight: 400;
    color: #6c757d;
}

.f4-pricing-card__description {
    font-size: 0.95rem;
    color: #6c757d;
    margin: 0 0 1.5rem;
    min-height: 40px;
}

.f4-pricing-card__features {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
    text-align: left;
    flex-grow: 1;
}

.f4-pricing-card__features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.f4-pricing-card__features svg {
    color: #1c1c78;
    flex-shrink: 0;
}

.f4-pricing-card .f4-dashboard__button {
    width: 100%;
}

.f4-pricing-login-prompt {
    font-family: 'Geist', sans-serif;
    text-align: center;
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
    margin: 2rem auto;
}
.f4-pricing-login-prompt h3 {
    margin-top: 0;
}
