/* Join V4 - Redesigned Clean Layout
   - Single column centered design
   - Responsive grid for membership cards
   - Modern clean aesthetic
*/

/* ---------- Font Face Declarations ---------- */
@font-face {
    font-family: 'Poppins';
    src: url('/custom/stplus/fonts/poppins/Poppins-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Poppins';
    src: url('/custom/stplus/fonts/poppins/Poppins-SemiBold.otf') format('opentype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Poppins';
    src: url('/custom/stplus/fonts/poppins/Poppins-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Poppins';
    src: url('/custom/stplus/fonts/poppins/Poppins-Black.otf') format('opentype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* ---------- Base / Reset ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', Arial, sans-serif;
    background-color: #e3e3e3;
    color: #333;
}

img {
    max-width: 100%;
    display: block;
    border: 0;
}

a {
    text-decoration: none;
    color: #0099dd;
}

a:hover {
    text-decoration: underline;
}

input, button, select, textarea {
    font-family: 'Poppins', Arial, sans-serif !important;
}

::placeholder {
    color: #999;
    opacity: 1;
}

/* Hide field labels - we use placeholders */
label[for="username_input"],
label[for="password_input"],
label[for="email_input"] {
    display: none !important;
}

/* ---------- Main Container ---------- */
.page-container {
    max-width: 940px;
    margin: 0 auto;
    padding: 40px 20px;
    background-color: #fff;
    min-height: 100vh;
}

/* ---------- Logo ---------- */
.join-logo {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.join-logo img {
    max-width: 320px;
    margin: 0 auto;
}

/* ---------- Section Headings ---------- */
.section-heading {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

/* ---------- Step 1: Account Creation ---------- */
.account-section {
    margin-bottom: 40px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.form-field {
    flex: 1;
}

.form-field.full-width {
    width: 100%;
}

.form-input {
    width: 100%;
    height: 48px;
    padding: 0 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    color: #333;
    transition: border-color 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: #0099dd;
}

.field-helper-text {
    font-size: 13px;
    color: #666;
    margin-top: 6px;
    line-height: 1.4;
}

/* ---------- Error Messages ---------- */

/* OPTION 1: Smooth Slide-In Animation Approach */
.error-wrapper {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
}

.error-wrapper.has-error {
    max-height: 60px;
    opacity: 1;
    margin-top: 6px;
}

/* Inline error message */
.join_error {
    background-color: transparent;
    border: none;
    color: #dc3545;
    padding: 0;
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

/* Add error icon before text */
.join_error::before {
    content: "⚠";
    flex-shrink: 0;
    font-size: 14px;
}

/* Input field with error - red border */
.form-input.has-error,
input.has-error {
    border-color: #dc3545 !important;
    background-color: #fff5f5;
}

/* Focus state for error inputs */
.form-input.has-error:focus,
input.has-error:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* OPTION 2: Helper text that changes to error (alternative approach) */
/* Uncomment below and update template to use this approach instead */
/*
.field-helper-text {
    font-size: 13px;
    color: #666;
    margin-top: 6px;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.field-helper-text.error-mode {
    color: #dc3545;
    font-weight: 500;
}

.field-helper-text.error-mode::before {
    content: "⚠ ";
}
*/

/* Error summary at top (for multiple errors) */
.error-summary {
    background-color: #ffe6e6;
    border-left: 4px solid #dc3545;
    color: #dc3545;
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-summary-title {
    font-weight: 700;
    margin-bottom: 8px;
}

.error-summary ul {
    margin: 0;
    padding-left: 20px;
    list-style: disc;
}

.error-summary li {
    margin-bottom: 4px;
}

/* ---------- Step 2: Membership Cards ---------- */
.membership-section {
    margin-bottom: 40px;
}

.membership-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 20px;
}

/* Hide legacy NATS option buttons */
.membership-grid .option.button,
.payment-grid .option.button {
    display: none !important;
}

.membership-card {
    position: relative;
    background-color: #e3e3e3;
    border: 2px solid #d6d6d6;
    border-radius: 8px;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.membership-card input[type="radio"] {
    position: absolute;
    left: -9999px;
}

.membership-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.membership-card.active {
    background-color: #0099dd;
    border-color: #0099dd;
    transform: scale(1.05) translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 153, 221, 0.3);
    z-index: 10;
}

.membership-card.active .card-duration,
.membership-card.active .card-price-main,
.membership-card.active .card-price-dollar,
.membership-card.active .card-price-cents,
.membership-card.active .card-price-label,
.membership-card.active .card-billing-info {
    color: #fff;
}

/* Popular Badge */
.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #dc3545;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 12px;
    text-transform: uppercase;
    white-space: nowrap;
}

.card-duration {
    font-size: 18px;
    font-weight: 700;
    color: #202937;
    margin-bottom: 8px;
    margin-top: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid #d6d6d6;
}

.card-price-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 0;
    margin-bottom: -20px;
}

.card-price-main {
    font-size: 70px;
    font-weight: 700;
    color: #202937;
    line-height: 0.9;
    -webkit-text-stroke: 0.5px currentColor;
    text-stroke: 0.5px currentColor;
}

.card-price-dollar {
    font-size: 42px;
    font-weight: 700;
    vertical-align: top;
    -webkit-text-stroke: 0.5px currentColor;
    text-stroke: 0.5px currentColor;
}

.card-price-right {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 2px;
}

.card-price-cents {
    font-size: 32px;
    font-weight: 700;
    color: #202937;
    line-height: 1;
    -webkit-text-stroke: 0.5px currentColor;
    text-stroke: 0.5px currentColor;
}

.card-price-label {
    font-size: 12px;
    color: #202937;
    font-weight: 400;
    line-height: 1.2;
}

.card-billing-info {
    font-size: 11px;
    color: #202937;
    line-height: 1.3;
    margin-top: 5px;
}

.card-start-btn {
    background-color: #0099dd;
    color: #fff;
    border: 2px solid transparent;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-top: auto;
    transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.membership-card.active .card-start-btn {
    background-color: #242424;
    color: #fff;
    border-color: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5), 0 0 20px rgba(255, 255, 255, 0.3);
}

.card-start-btn:hover {
    opacity: 0.9;
}

/* Promo Code Link */
.promo-link {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
}

.promo-link a {
    color: #0099dd;
    text-decoration: none;
    font-weight: 600;
}

.promo-link a:hover {
    text-decoration: underline;
}

.add-promo-code {
    display: none;
    margin-top: 15px;
    text-align: center;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.promo-input {
    width: 250px;
    height: 44px;
    padding: 0 15px;
    border: 2px solid #d6d6d6;
    border-radius: 6px;
    font-size: 15px;
    color: #333;
    transition: border-color 0.3s;
}

.promo-input:focus {
    outline: none;
    border-color: #0099dd;
}

.promo-input::placeholder {
    color: #999;
}

.promo-apply-btn {
    height: 44px;
    padding: 0 30px;
    background-color: #0099dd;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s;
}

.promo-apply-btn:hover {
    background-color: #0088cc;
}

/* ---------- Step 3: Payment Methods ---------- */
.payment-section {
    margin-bottom: 30px;
}

.payment-grid {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.payment-option {
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 8px 12px;
    width: 140px;
    max-width: 140px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.payment-option input[type="radio"] {
    position: absolute;
    left: -9999px;
}

.payment-option:hover {
    border-color: #0099dd;
    box-shadow: 0 2px 8px rgba(0, 153, 221, 0.2);
}

.payment-option.active {
    border-color: #5cb85c;
    border-width: 3px;
    box-shadow: 0 2px 12px rgba(92, 184, 92, 0.3);
}

.payment-option img {
    max-width: 100%;
    max-height: 40px;
    object-fit: contain;
}

.payment-option .payment-grey {
    display: block;
}

.payment-option .payment-color {
    display: none;
}

.payment-option.active .payment-grey {
    display: none;
}

.payment-option.active .payment-color {
    display: block;
}

/* ---------- Checkboxes ---------- */
.checkbox-container {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    font-size: 13px;
    color: #666;
}

.checkbox-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-container a {
    color: #0099dd;
}

/* ---------- Complete Button ---------- */
.submit-section {
    margin-top: 25px;
    margin-bottom: 40px;
    text-align: center;
}

.complete-btn {
    width: auto;
    min-width: 400px;
    max-width: 600px;
    height: 56px;
    background-color: #5cb85c;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.3s ease;
    padding: 0 40px;
}

.complete-btn:hover {
    background-color: #4cae4c;
}

.complete-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* ---------- Channel Logos Section ---------- */
.channels-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #ddd;
}

.channels-heading {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin-bottom: 30px;
}

.channels-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
}

.channel-logo {
    width: auto;
    max-width: 120px;
    height: 50px;
    object-fit: contain;
}

.channels-more {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-top: 20px;
}

/* ---------- Footer ---------- */
.footer-section {
    margin-top: 40px;
    text-align: center;
}

.help-btn {
    background-color: #0099dd;
    color: #fff;
    border: none;
    padding: 14px 40px;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: inline-block;
    margin-bottom: 30px;
}

.help-btn:hover {
    background-color: #0088cc;
    text-decoration: none;
}

.footer-copyright {
    font-size: 12px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.footer-copyright p {
    margin-bottom: 10px;
}

.footer-rta {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.footer-rta img {
    max-width: 100px;
}

/* ---------- Responsive Design ---------- */

/* Desktop (992px - 1199px) - 3 cards per row */
@media (min-width: 992px) and (max-width: 1199px) {
    .membership-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet (768px - 991px) - 2 cards per row */
@media (min-width: 768px) and (max-width: 991px) {
    .page-container {
        padding: 30px 20px;
    }

    .membership-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-heading {
        font-size: 22px;
    }
}

/* Mobile (< 768px) - 1 card per row, stacked */
@media (max-width: 767px) {
    .page-container {
        padding: 20px 15px;
    }

    .join-logo img {
        max-width: 240px;
    }

    .section-heading {
        font-size: 20px;
        text-align: center;
    }

    .form-row {
        flex-direction: column;
        gap: 15px;
    }

    .membership-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* Mobile: horizontal layout with price on right */
    .membership-card {
        position: relative;
        min-height: 120px;
        padding-right: 45%;
    }

    .card-duration {
        text-align: left;
        font-size: 20px;
        border-bottom: none;
        padding-bottom: 8px;
        margin-bottom: 8px;
        padding-right: 10px;
        overflow-wrap: break-word;
        word-wrap: break-word;
        hyphens: auto;
    }

    .card-billing-info {
        text-align: left;
        font-size: 11px;
        line-height: 1.4;
        padding-right: 10px;
    }

    .card-price-wrapper {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        right: 15px;
        width: 40%;
        flex-direction: row;
        align-items: flex-start;
        justify-content: flex-end;
        text-align: right;
        margin-bottom: 0;
        gap: 0;
    }

    .card-price-main {
        font-size: 55px;
        line-height: 55px;
        display: flex;
        align-items: flex-start;
    }

    .card-price-dollar {
        font-size: 30px;
        line-height: 55px;
    }

    .card-price-right {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding-top: 2px;
    }

    .card-price-cents {
        font-size: 25px;
        line-height: 1;
    }

    .card-price-label {
        font-size: 11px;
        line-height: 1.2;
    }

    .card-start-btn {
        display: none;
    }

    /* Fix active card transform on mobile */
    .membership-card.active {
        transform: scale(1.02);
    }

    .payment-grid {
        flex-direction: column;
        align-items: center;
    }

    .payment-option {
        width: 100%;
        max-width: 300px;
    }

    .channels-heading {
        font-size: 18px;
    }

    .channels-grid {
        gap: 15px;
    }

    .complete-btn {
        height: 50px;
        font-size: 18px;
        min-width: 280px;
        width: 100%;
        max-width: 100%;
    }
}

/* Small Mobile (< 480px) */
@media (max-width: 479px) {
    .page-container {
        padding: 15px 10px;
    }

    .channels-grid {
        gap: 10px;
    }

    .card-price {
        font-size: 36px;
    }

    .form-input {
        height: 44px;
        font-size: 14px;
    }
}

/* Extra Small Mobile (≤ 360px) - Fix price wrapping */
@media (max-width: 360px) {
    .membership-card {
        padding-right: 40%;
    }

    .card-price-wrapper {
        width: 38%;
        right: 10px;
    }

    .card-price-main {
        font-size: 48px;
        line-height: 48px;
    }

    .card-price-dollar {
        font-size: 28px;
        line-height: 48px;
    }

    .card-price-cents {
        font-size: 22px;
    }

    .card-price-label {
        font-size: 10px;
        white-space: nowrap;
    }

    .card-duration {
        font-size: 16px;
    }

    .card-billing-info {
        font-size: 10px;
    }
}

/* ---------- NoScript Fallback ---------- */
noscript .jscript-only {
    display: none;
}
