/* sys-subscribers.css
 * Subscriber Pages Styling (Login, Registration, Account)
 * Mobile-first responsive design
 */

/* ============================================
   CSS Variables (customizable via inline style)
   ============================================ */
:root {
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --text-color: #212529;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
    --border-hover: #dee2e6;
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    --card-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    --btn-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

/* ============================================
   Base Layout
   ============================================ */
body.subscriber-page {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================
   Main Card Container
   ============================================ */
.subscriber-card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    max-width: 560px;
    width: 100%;
    overflow: hidden;
}

/* ============================================
   Card Header
   ============================================ */
.subscriber-header {
    background: var(--primary-color);
    color: white;
    padding: 24px 20px;
    text-align: center;
}

.subscriber-header h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

.subscriber-header p {
    margin: 8px 0 0;
    opacity: 0.9;
    font-size: 14px;
}

/* ============================================
   Step Progress Indicator
   ============================================ */
.step-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    padding: 0 10px;
    gap: 4px;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.step-item.active .step-circle,
.step-item.completed .step-circle {
    background: white;
    color: var(--primary-color);
}

.step-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.step-item.active .step-label,
.step-item.completed .step-label {
    color: white;
}

.step-line {
    width: 40px;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 6px;
    margin-bottom: 18px;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.step-line.completed {
    background: white;
}

/* ============================================
   Card Body
   ============================================ */
.subscriber-body {
    padding: 24px 20px;
}

/* ============================================
   Form Controls
   ============================================ */
.subscriber-page .form-control {
    border-radius: 8px;
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-size: 16px; /* Prevents zoom on iOS */
}

.subscriber-page .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    outline: none;
}

.subscriber-page .form-label {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 6px;
}

/* ============================================
   Buttons
   ============================================ */
.subscriber-page .btn-primary {
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 16px;
    width: 100%;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.subscriber-page .btn-primary:hover,
.subscriber-page .btn-primary:focus {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--btn-shadow);
}

.subscriber-page .btn-primary:active {
    transform: translateY(0);
}

.subscriber-page .btn-outline-secondary {
    border-radius: 8px;
    padding: 12px 16px;
    font-weight: 500;
}

/* ============================================
   Social Login Buttons
   ============================================ */
.social-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--text-muted);
}

.social-divider::before,
.social-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-hover);
}

.social-divider span {
    padding: 0 12px;
    font-size: 13px;
}

.social-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.social-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--border-hover);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 20px;
    color: var(--text-muted);
}

.social-btn:hover {
    transform: scale(1.1);
}

.social-btn.google:hover {
    border-color: #db4437;
    color: #db4437;
}

.social-btn.facebook:hover {
    border-color: #4267B2;
    color: #4267B2;
}

.social-btn.apple:hover {
    border-color: #000;
    color: #000;
}

/* ============================================
   Alert Messages
   ============================================ */
.subscriber-page .alert {
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 12px 16px;
    font-size: 14px;
}

/* ============================================
   Plans Grid Layout
   ============================================ */
.plans-grid {
    display: flex;
    flex-direction: row;
    gap: 12px;
    margin-bottom: 16px;
    justify-content: center;
}

.plan-card {
    flex: 1 1 0;
    min-width: 0;
    max-width: 250px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0;
    background: white;
}

.plan-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.plan-card.selected {
    border-color: var(--primary-color);
    background: rgba(0, 123, 255, 0.05);
}

.plan-card input[type="radio"] {
    display: none;
}

.plan-name {
    margin-bottom: 4px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.plan-desc {
    margin-bottom: 10px;
    font-size: 13px;
}

.plan-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
    line-height: 1.2;
}

.plan-price small {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-muted);
}

/* ============================================
   Payment Summary
   ============================================ */
#paymentSummary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
}

/* ============================================
   Spinner Overlay
   ============================================ */
.spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-overlay.active {
    display: flex;
}

/* ============================================
   Account Page Specific
   ============================================ */
.account-section {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.account-section h5 {
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
}

.subscription-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.subscription-status.active {
    background: #d4edda;
    color: #155724;
}

.subscription-status.expired {
    background: #f8d7da;
    color: #721c24;
}

.subscription-status.pending {
    background: #fff3cd;
    color: #856404;
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */

/* Small tablets and large phones */
@media (max-width: 576px) {
    body.subscriber-page {
        padding: 12px;
        align-items: flex-start;
        padding-top: 20px;
    }

    .subscriber-card {
        border-radius: 12px;
        max-width: 100%;
    }

    .subscriber-header {
        padding: 20px 16px;
    }

    .subscriber-header h1 {
        font-size: 20px;
    }

    .subscriber-header p {
        font-size: 13px;
    }

    .subscriber-body {
        padding: 20px 16px;
    }

    /* Step Progress - Compact */
    .step-progress {
        margin-top: 16px;
        padding: 0 8px;
    }

    .step-circle {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .step-label {
        font-size: 9px;
    }

    .step-line {
        width: 30px;
        margin: 0 4px;
        margin-bottom: 16px;
    }

    /* Plans Stack Vertically */
    .plans-grid {
        flex-direction: column;
        gap: 12px;
    }

    .plan-card {
        max-width: 100%;
        padding: 16px;
    }

    .plan-name {
        font-size: 16px;
    }

    .plan-price {
        font-size: 26px;
    }

    /* Form adjustments */
    .subscriber-page .form-control {
        padding: 10px 12px;
    }

    .subscriber-page .btn-primary {
        padding: 12px 16px;
    }

    /* Button groups stack on mobile */
    .d-flex.gap-2 {
        flex-direction: column;
    }

    .d-flex.gap-2 .btn-outline-secondary {
        order: 2;
        margin-top: 8px;
    }

    .d-flex.gap-2 .btn-primary {
        order: 1;
    }

    /* Social buttons smaller */
    .social-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    /* Account sections */
    .account-section {
        padding: 16px;
    }

    .account-section h5 {
        font-size: 15px;
    }
}

/* Extra small phones */
@media (max-width: 380px) {
    .subscriber-header h1 {
        font-size: 18px;
    }

    .step-circle {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }

    .step-label {
        font-size: 8px;
    }

    .step-line {
        width: 24px;
    }

    .plan-price {
        font-size: 24px;
    }

    .subscriber-body {
        padding: 16px 12px;
    }
}

/* Tablet landscape and small desktop */
@media (min-width: 577px) and (max-width: 768px) {
    .subscriber-card {
        max-width: 520px;
    }

    .plans-grid {
        gap: 16px;
    }

    .plan-card {
        padding: 18px;
    }
}

/* Desktop and larger */
@media (min-width: 769px) {
    .subscriber-card {
        max-width: 600px;
    }

    .subscriber-header {
        padding: 30px;
    }

    .subscriber-body {
        padding: 30px;
    }

    .step-line {
        width: 50px;
    }

    .plan-card {
        padding: 20px;
    }

    .plan-price {
        font-size: 32px;
    }
}

/* ============================================
   Touch Device Optimizations
   ============================================ */
@media (hover: none) {
    .plan-card:hover {
        box-shadow: none;
    }

    .social-btn:hover {
        transform: none;
    }

    .subscriber-page .btn-primary:hover {
        transform: none;
    }

    /* Larger touch targets */
    .plan-card {
        min-height: 120px;
    }

    .social-btn {
        width: 52px;
        height: 52px;
    }
}

/* ============================================
   Dark Mode Support (optional)
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* Can be enabled if needed */
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    body.subscriber-page {
        background: white;
        padding: 0;
    }

    .subscriber-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .spinner-overlay,
    .social-buttons,
    .social-divider {
        display: none !important;
    }
}
