/* ==========================================
   1. MESSAGGI DI FEEDBACK E ALERT
   ========================================== */
.wpsub-alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 0 0 25px 0;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: opacity 0.5s ease, transform 0.5s ease;
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
}

.wpsub-alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.wpsub-alert-error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.wpsub-fade-out {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.wpsub-alert a {
    color: #721c24;
    font-weight: bold;
    text-decoration: underline;
}

.wpsub-feedback {
    text-align: center;
    margin-top: 15px;
    font-weight: bold;
    padding: 10px;
    border-radius: 4px;
    display: none;
}

.wpsub-feedback.success {
    display: block;
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

.wpsub-feedback.error {
    display: block;
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

.wpsub-feedback.warning {
    display: block;
    color: #856404;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
}

.wpsub-paypal-wrapper {
    max-width: 400px;
    margin: 0 auto;
}

/* ==========================================
   2. DASHBOARD ACCOUNT & PROFILO
   ========================================== */
.wpsub-login-required-notice {
    background-color: #fff3cd;
    color: #856404;
    padding: 15px 20px;
    border-left: 4px solid #ffeeba;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    width: 90%;
    max-width: 450px;
    margin: 7rem auto 30px;
}

.wpsub-dashboard-wrapper {
    display: flex;
    flex-wrap: wrap;
    margin: 80px auto 60px auto;
    font-family: inherit;
    max-width: 1200px;
    gap: 30px;
}

.wpsub-dashboard-sidebar {
    flex: 1;
    min-width: 250px;
    margin-bottom: 20px;
}

.wpsub-dashboard-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #eaeaea;
    overflow: hidden;
}

.wpsub-dashboard-sidebar li {
    margin: 0;
    border-bottom: 1px solid #f0f0f0;
}

.wpsub-dashboard-sidebar li:last-child {
    border-bottom: none;
}

.wpsub-tab-btn {
    width: 100%;
    text-align: left;
    padding: 18px 20px;
    background: #ffffff;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    color: #50575e;
    transition: all 0.3s ease;
    display: block;
    outline: none;
}

.wpsub-tab-btn:hover {
    background: #f8f9fa;
    color: var(--wpsub-main-color);
}

.wpsub-tab-btn.active {
    color: var(--wpsub-main-color);
    border-left: 4px solid var(--wpsub-main-color);
}

.wpsub-dashboard-sidebar a[href*="logout"] {
    display: block;
    padding: 18px 20px;
    color: #d63638;
    font-weight: 600;
    text-decoration: none;
    background: #fffdfd;
    transition: background 0.3s ease;
}

.wpsub-dashboard-sidebar a[href*="logout"]:hover {
    background: #fcf0f1;
}

.wpsub-dashboard-content {
    flex: 3;
    min-width: 300px;
    padding: 40px;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.wpsub-dashboard-content h3 {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 24px;
    color: #2c3338;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

/* Specificità titoli tab e formattazione fine */
.wpsub-dash-title {
    margin-bottom: 5px !important;
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

.wpsub-dash-subtitle {
    margin-top: 0;
}

.wpsub-dash-desc {
    color: #646970;
    margin-bottom: 25px;
}

.wpsub-divider {
    margin: 35px 0;
    border: 0;
    border-top: 1px solid #eee;
}

/* Controlli input profilo */
#tab-profilo label {
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
    color: #50575e;
}

#tab-profilo input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    box-sizing: border-box;
}

#tab-profilo input:focus {
    border-color: var(--wpsub-main-color);
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.2);
    outline: none;
}

#tab-profilo .btn {
    padding: 12px 24px;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    margin-bottom: 0;
}

.wpsub-email-static {
    background: #f0f0f1;
}

.wpsub-actions-wrapper {
    margin-top: 20px;
}

.wpsub-btn-group-flex {
    display: flex;
    gap: 15px;
    align-items: center;
}

.wpsub-flex-btn {
    margin: 0;
    width: 100%;
    flex: 1;
}

.wpsub-readonly-input.wpsub-editable {
    background-color: #fff;
    border-color: var(--wpsub-main-color);
}

/* Sezione: Dispositivi */
.wpsub-device-box {
    background: #f8f9fa;
    border: 1px solid #e2e4e7;
    border-radius: 6px;
    padding: 15px;
}

.wpsub-device-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wpsub-device-item {
    padding: 10px 0;
    border-bottom: 1px solid #e2e4e7;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wpsub-badge-current {
    background: #d4edda;
    color: #155724;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

/* Sezione: Abbonamento */
.wpsub-sub-box {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.wpsub-sub-active {
    background-color: #d4edda;
    border-color: #155724;
    color: #155724;
}

.wpsub-sub-inactive {
    background-color: #f8d7da;
    border-color: #721c24;
    color: #721c24;
}

.wpsub-sub-box-title {
    margin: 0 0 10px 0;
}

.wpsub-sub-box-text {
    margin: 0 0 5px 0;
}

.wpsub-sub-box-id {
    margin: 0;
    font-size: 0.9em;
    opacity: 0.8;
}

.wpsub-renewal-box {
    padding: 20px;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    background: #fcfcfc;
}

.wpsub-renewal-desc {
    font-size: 14px;
    color: #646970;
    line-height: 1.5;
    margin-bottom: 15px;
}

/* ==========================================
   3. GRIGLIA EDICOLA DIGITALE
   ========================================== */
.wpsub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 30px;
}

.wpsub-read-alert {
    text-align: center;
    padding: 20px;
    background: #f8d7da;
    color: #721c24;
    border-radius: 6px;
}

.wpsub-read-alert-title {
    margin-bottom: 15px;
}

.wpsub-no-issues {
    margin-top: 20px;
}

.wpsub-r2-error {
    color: red;
    font-size: 13px;
    margin: 10px 0 0;
}

.wpsub-df-btn {
    cursor: pointer;
}

/* ==========================================
   4. BLINDATURA VISIVA FORM LOGIN E REGISTRAZIONE
   ========================================== */
.wrap-subscription {
    padding: 4rem 0;
}

.wpsub-auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    margin-top: 60px;
    margin-bottom: 60px;
    width: 100%;
    box-sizing: border-box;
}

.wpsub-auth-box {
    background: #ffffff;
    max-width: 450px;
    width: 100%;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid #eaeaea;
}

.wpsub-auth-title {
    text-align: center;
    margin: 0 0 30px 0;
    font-size: 26px;
    font-weight: 700;
    color: #2c3338;
    display: block;
    width: 100%;
    clear: both;
}

.wpsub-auth-box form, .wpsub-auth-box form p, .wpsub-form-group {
    display: block;
    width: 100%;
    margin: 0 0 20px 0;
    padding: 0;
    text-align: left;
}

#wpsub-login-form label, #wpsub-register-form label, .wpsub-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #50575e;
}

#wpsub-login-form input[type="text"], #wpsub-login-form input[type="password"], #wpsub-register-form input[type="text"], #wpsub-register-form input[type="password"], #wpsub-register-form input[type="email"], .wpsub-form-group input[type="text"], .wpsub-pwd-wrapper input[type="password"] {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    font-size: 16px;
    color: #3c434a;
    box-sizing: border-box;
    height: 48px;
    background: #fff;
}

#wpsub-login-form input[type="text"]:focus, #wpsub-login-form input[type="password"]:focus, #wpsub-register-form input:focus {
    border-color: var(--wpsub-main-color);
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.2);
    outline: none;
}

.login-remember {
    display: flex;
    align-items: center;
}

.login-remember label {
    margin: 0;
    font-weight: normal;
}

.login-remember input[type="checkbox"] {
    margin: 0 8px 0 0;
    width: auto;
    height: auto;
}

#wpsub-login-form input[type="submit"], #wpsub-register-form button[type="submit"] {
    width: 100%;
    padding: 14px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.wpsub-auth-footer {
    text-align: center;
    margin-top: 25px;
    font-size: 14px;
    color: #646970;
    width: 100%;
}

.wpsub-auth-footer a {
    text-decoration: none;
    font-weight: 600;
}

.wpsub-auth-footer a:hover {
    text-decoration: underline;
}

/* Password Meter */
.wpsub-pwd-meter {
    margin-top: 10px;
    margin-bottom: 15px;
}

.wpsub-pwd-progress-bg {
    height: 5px;
    background: #ccd0d4;
    border-radius: 3px;
    overflow: hidden;
}

.wpsub-pwd-progress {
    width: 0%;
    height: 100%;
    background: #d63638;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.wpsub-pwd-rules {
    list-style: none;
    padding: 0;
    margin: 5px 0 0 0;
    font-size: 12px;
    color: #50575e;
    line-height: 1.4;
}

.wpsub-pwd-rule {
    transition: color 0.2s;
}

.wpsub-pwd-rule.rule-valid {
    color: #155724;
    font-weight: 600;
}

.wpsub-pwd-rule.rule-invalid {
    color: #50575e;
}

.wpsub-pwd-wrapper {
    position: relative;
    width: 100%;
}

.wpsub-pwd-wrapper input[type="password"], .wpsub-pwd-wrapper input[type="text"] {
    padding-right: 70px;
}

.wpsub-toggle-pwd {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
}

.wpsub-toggle-pwd:hover {
    text-decoration: underline;
}

.rule-icon {
    display: inline-block;
    width: 15px;
    font-weight: bold;
}

/* ==========================================
   5. PRICING CARDS (Layout Orizzontale a 2 Colonne)
   ========================================== */
.wpsub-pricing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    max-width: 1000px;
    margin: 1rem auto 40px auto;
    padding: 0 20px;
}

.wpsub-pricing-card {
    width: 100%;
    max-width: 700px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.06);
    border: 1px solid #eaeaea;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: row;
    position: relative;
}

.wpsub-pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.wpsub-pricing-image-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 45%;
    border-right: 1px solid #eaeaea;
}

.wpsub-pricing-cover {
    max-height: 450px;
    width: auto;
    object-fit: contain;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    border-radius: 2px;
}

.wpsub-pricing-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.wpsub-pricing-header {
    text-align: center;
    padding: 2.5rem 2.5rem 0;
}

.wpsub-pricing-maintitle {
    font-weight: 800;
    margin-bottom: 0;
}

.wpsub-pricing-duration-box {
    display: flex;
    justify-content: center;
    align-items: baseline;
    padding: 1rem;
}

.wpsub-pricing-duration {
    font-size: 1.25rem;
    color: #212529;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0;
    margin-right: 0.5rem;
}

.wpsub-pricing-issues {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0;
}

.wpsub-price {
    display: flex;
    justify-content: center;
    align-items: baseline;
    margin-bottom: 1.5rem;
    line-height: 1;
}

.wpsub-amount {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.wpsub-currency {
    font-size: 1.3rem;
    font-weight: 700;
    margin-right: 0.2rem;
}

.wpsub-pricing-body {
    padding: 0 2.5rem 2.5rem;
}

.wpsub-card-active {
    border: 2px solid #eaeaea;
}

.wpsub-active-badge {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.4rem 2rem;
    border-radius: 0 0 8px 8px;
    font-size: 0.8rem;
    font-weight: 800;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 2;
    white-space: nowrap;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .wpsub-pricing-card {
        flex-direction: column;
        max-width: 350px;
    }

    .wpsub-pricing-image-wrap {
        border-right: none;
        border-bottom: 1px solid #eaeaea;
        padding: 2rem;
    }

    .wpsub-pricing-header {
        padding: 2rem 1.5rem 0;
    }

    .wpsub-pricing-body {
        padding: 0 1.5rem 2rem;
    }
}

/* ==========================================
   6. PAYWALL E DFLIP SECURITY
   ========================================== */
.wpsub-paywall-excerpt {
    position: relative;
}

.wpsub-paywall-text {
    padding-bottom: 40px;
    color: #333333;
}

.wpsub-paywall-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 90%);
    pointer-events: none;
}

.wpsub-paywall-box {
    background: #f8f9fa;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    padding: 40px 30px;
    text-align: center;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    position: relative;
    z-index: 10;
}

.wpsub-paywall-icon {
    font-size: 40px;
    width: 40px;
    height: 40px;
    color: var(--wpsub-main-color);
    margin-bottom: 15px;
}

.wpsub-paywall-title {
    margin-top: 0;
    color: var(--wpsub-main-color);
    font-size: 24px;
}

.wpsub-paywall-desc {
    font-size: 16px;
    color: #555555;
    margin-bottom: 30px;
}

.wpsub-paywall-btn {
    display: inline-block;
    background: #46b450;
    color: #ffffff;
    padding: 15px 30px;
    border-radius: 4px;
    font-weight: bold;
    text-decoration: none;
    margin-bottom: 15px;
    font-size: 16px;
    transition: background 0.3s ease;
}

.wpsub-paywall-btn:hover {
    background: #3a9542;
    color: #ffffff;
}

.wpsub-paywall-login {
    margin-bottom: 0;
    font-size: 15px;
    color: #777777;
}

.wpsub-paywall-login a {
    color: var(--wpsub-main-color);
    font-weight: bold;
    text-decoration: underline;
}

.df-ui-btn.df-ui-download, .df-ui-btn.df-ui-share, .df-ui-btn.df-ui-more {
    display: none;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    width: 0;
    height: 0;
}

/* ==========================================
   7. OVERRIDE BOOTSTRAP (Design Custom Edicola)
   ========================================== */
#wpsubYearTabs.nav-tabs {
    border-bottom: none;
    gap: 12px;
    margin-bottom: 2rem;
}

#wpsubYearTabs .nav-link {
    border: 1px solid #eaeaea;
    background-color: #f8f9fa;
    color: #50575e;
    border-radius: 30px;
    padding: 10px 25px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
}

#wpsubYearTabs .nav-link:hover {
    background-color: #f0f6fc;
    color: var(--wpsub-main-color);
    border-color: var(--wpsub-main-color);
}

#wpsubYearTabs .nav-link.active {
    background-color: var(--wpsub-main-color);
    color: #ffffff;
    border-color: var(--wpsub-main-color);
    box-shadow: 0 4px 10px rgba(227, 6, 19, 0.3);
}

#wpsubYearTabsContent .accordion-item {
    overflow: hidden;
    margin-bottom: 15px;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

#wpsubYearTabsContent .accordion-button {
    font-weight: 700;
    font-size: 1.1rem;
    color: #2c3338;
    padding: 1.2rem 1.5rem;
    box-shadow: none;
    border-bottom: 1px solid var(--wpsub-main-color);
    border-radius: 0;
}

#wpsubYearTabsContent .accordion-button:not(.collapsed) {
    color: var(--wpsub-main-color);
    background-color: #fff;
}

#wpsubYearTabsContent .accordion-button::after {
    filter: brightness(0) saturate(100%) invert(30%);
}

#wpsubYearTabsContent .accordion-button:not(.collapsed)::after {
    filter: brightness(0) saturate(100%) invert(40%) sepia(100%) hue-rotate(190deg);
}

#wpsubYearTabsContent .accordion-body {
    padding: 2rem;
    background-color: #ffffff;
}

#wpsubYearTabsContent .wpsub-grid {
    align-items: stretch;
}

#wpsubYearTabsContent .wpsub-issue-card {
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    overflow: hidden;
}

#wpsubYearTabsContent .wpsub-issue-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.12);
}

#wpsubYearTabsContent .wpsub-issue-cover {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-bottom: 1px solid #f0f0f0;
    margin: 0;
    padding: 0;
    border-radius: 0;
}

#wpsubYearTabsContent .wpsub-issue-info {
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

#wpsubYearTabsContent .wpsub-issue-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #2c3338;
    margin-bottom: 25px;
    line-height: 1.4;
}

#wpsubYearTabsContent .wpsub-btn-read {
    margin-top: auto;
    border-radius: 8px;
    font-weight: 600;
    padding: 12px 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

/* ==========================================
   MODALE DISPOSITIVI MULTIPLI E LOGIN
   ========================================= */
#wpsub-devices-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.wpsub-modal-content {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.wpsub-modal-title {
    margin-top: 0;
    color: #d63638;
}

.wpsub-modal-desc {
    font-size: 14px;
    color: #50575e;
    margin-bottom: 20px;
}

#wpsub-devices-list {
    margin-bottom: 20px;
}

.wpsub-modal-footer {
    text-align: right;
}

.wpsub-btn-cancel {
    background: #f0f0f1;
    color: #3c434a;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.wpsub-btn-cancel:hover {
    background: #e2e4e7;
}

.wpsub-login-error {
    color: #721c24;
    background: #f8d7da;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: none;
    font-weight: bold;
    font-size: 14px;
}

.wpsub-device-item {
    padding: 12px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.wpsub-device-info {
    line-height: 1.4;
}

.wpsub-device-ua {
    color: #1d2327;
}

.wpsub-device-meta {
    color: #646970;
}

.wpsub-btn-disconnect {
    background: #d63638;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    transition: background 0.2s;
}

.wpsub-btn-disconnect:hover {
    background: #b32d2e;
}
