/* ==========================================================================
   Test Registration Page - Peacock TV Inspired Layout
   Two-column design with form and plan information
   ========================================================================== */

/* ==========================================================================
   1. CSS Variables & Reset
   ========================================================================== */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --hero-bg: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e40af 100%);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent-blue: #667eea;
    --accent-green: #10b981;
    --surface-light: rgba(255, 255, 255, 0.98);
    --surface-glass: rgba(255, 255, 255, 0.1);
    --border-light: rgba(255, 255, 255, 0.2);
    --border-gray: #e2e8f0;
    --background-subtle: #f8fafc;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--hero-bg);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

/* ==========================================================================
   2. Header (matching login.html)
   ========================================================================== */
.header {
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
}

.emoji {
    color: var(--accent-blue);
    filter: none;
    -webkit-text-fill-color: initial;
}

.gradient-text {
    background: var(--primary-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-nav {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    padding: 8px 12px;
    border-radius: 6px;
}

.nav-link:hover {
    color: white;
    background: var(--surface-glass);
}

/* ==========================================================================
   3. Main Layout - Peacock TV Inspired Two-Column with Hero Background
   ========================================================================== */
.main-content {
    padding: 16px 12px;
    min-height: calc(100vh - 80px);
    position: relative; /* Added for hero positioning */
}

/* Hero Background */
.registration-hero-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('images/landing/hero/reg-hero-bg.jpg'); /* Add your chosen image */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    z-index: -1;
    opacity: 0.3; /* Very subtle so it doesn't interfere with form readability */
}

/* Optional: Animated gradient overlay for visual interest */
.registration-hero-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg, 
        rgba(102, 126, 234, 0.04) 0%,
        rgba(118, 75, 162, 0.04) 50%,
        rgba(30, 64, 175, 0.04) 100%
    );
    animation: subtleRegistrationShift 25s ease-in-out infinite alternate;
}

@keyframes subtleRegistrationShift {
    0% { opacity: 0.02; }
    100% { opacity: 0.06; }
}

.checkout-container {
    max-width: 800px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 16px;
    align-items: start;
    position: relative; /* Ensure content stays above hero background */
    z-index: 1;
}

/* ==========================================================================
   4. Form Column
   ========================================================================== */
.form-column {
    background: var(--surface-light);
    backdrop-filter: blur(20px);
    border-radius: 8px;
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.06),
        0 2px 4px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-light);
    padding: 16px;
    position: relative;
    overflow: hidden;
    z-index: 2; /* Ensure form stays above hero background */
}

.form-column::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

.form-header {
    margin-bottom: 12px;
    text-align: center;
}

.form-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.form-header p {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.account-section h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-gray);
}

/* ==========================================================================
   5. Form Styling
   ========================================================================== */
.registration-form {
    max-width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.form-group {
    margin-bottom: 10px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

/* Required field indicator styling */
.form-group label::after {
    content: '';
}

.form-group label:has(+ input[required])::after,
.form-group label[for="firstName"]::after,
.form-group label[for="lastName"]::after {
    content: '';
    color: #ef4444;
    margin-left: 2px;
    font-weight: 600;
}

/* Alternative approach for required indicators */
.form-group input[required] {
    border-left: 3px solid rgba(239, 68, 68, 0.3);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-gray);
    border-radius: 4px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    transition: all 0.2s ease;
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.help-text {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: 1.2;
}

/* ==========================================================================
   6. Password Toggle (matching login.css)
   ========================================================================== */
.password-input-container {
    position: relative;
    display: block; /* Changed from flex to block to prevent horizontal flow */
    width: 100%;
}

.password-input-container input {
    width: 100%;
    padding-right: 32px;
}

.password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 1px;
    border-radius: 3px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    z-index: 10;
}

.password-toggle:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--accent-blue);
    transform: translateY(-50%) scale(1.05);
}

.password-toggle:focus {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* Password toggle visibility states */
.password-toggle .show-text,
.password-toggle .hide-text {
    font-size: 0.8rem;
    line-height: 1;
    user-select: none;
}

.password-toggle .hidden {
    display: none;
}

/* ==========================================================================
   7. Optional Section
   ========================================================================== */
.optional-section {
    margin: 12px 0;
    padding: 10px;
    background: var(--background-subtle);
    border-radius: 6px;
    border: 1px solid var(--border-gray);
}

.optional-section h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.info-icon {
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: help;
}

/* ==========================================================================
   8. Terms and Checkboxes
   ========================================================================== */
.terms-section {
    margin: 12px 0;
    padding: 8px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    margin-bottom: 8px;
    line-height: 1.3;
}

.checkbox-label:last-child {
    margin-bottom: 0;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0 6px 0 0;
    transform: scale(1);
    accent-color: var(--accent-blue);
    flex-shrink: 0;
}

.terms-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.terms-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* ==========================================================================
   9. Promo Code Section
   ========================================================================== */
.promo-section {
    margin: 10px 0;
}

.promo-toggle {
    background: none;
    border: none;
    color: var(--accent-blue);
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.promo-toggle:hover {
    color: #764ba2;
}

.toggle-icon {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.promo-toggle.active .toggle-icon {
    transform: rotate(45deg);
}

.promo-input {
    margin-top: 8px;
    animation: slideDown 0.3s ease;
}

.promo-input.hidden {
    display: none;
}

/* ==========================================================================
   10. Create Account Button
   ========================================================================== */
.create-account-btn {
    width: 100%;
    padding: 10px 16px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    margin-top: 12px;
}

.create-account-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.4);
}

.create-account-btn:active {
    transform: translateY(0);
}

.signin-link {
    text-align: center;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border-gray);
}

.signin-link p {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.switch-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.switch-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* ==========================================================================
   11. Plan Column
   ========================================================================== */
.plan-column {
    position: sticky;
    top: 80px;
    z-index: 2; /* Ensure plan column stays above hero background */
}

.plan-card {
    background: var(--surface-light);
    backdrop-filter: blur(20px);
    border-radius: 8px;
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.06),
        0 2px 4px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-light);
    padding: 12px;
    margin-bottom: 10px;
}

.plan-header {
    text-align: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-gray);
}

.plan-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.plan-badge {
    display: inline-block;
    background: var(--accent-green);
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
}

.plan-features h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}

.feature-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.feature-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.feature-content strong {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1px;
    font-size: 0.75rem;
}

.feature-content p {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.2;
}

.feature-item.coming-soon {
    opacity: 0.7;
}

.coming-tag {
    display: inline-block;
    background: rgba(102, 126, 234, 0.1);
    color: var(--accent-blue);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 4px;
}

.plan-upgrade {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-gray);
    text-align: center;
}

.plan-upgrade h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.plan-upgrade p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.upgrade-link {
    display: inline-block;
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 16px;
    border: 1px solid var(--accent-blue);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.upgrade-link:hover {
    background: var(--accent-blue);
    color: white;
    transform: translateY(-1px);
}

/* ==========================================================================
   12. Security Notice
   ========================================================================== */
.security-notice {
    background: var(--surface-light);
    backdrop-filter: blur(20px);
    border-radius: 8px;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.04),
        0 1px 2px rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-light);
    padding: 10px;
}

.security-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.security-icon {
    font-size: 0.9rem;
    color: var(--accent-green);
}

.security-header h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.security-features {
    list-style: none;
    padding: 0;
}

.security-features li {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    padding-left: 12px;
    position: relative;
}

.security-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-green);
    font-weight: 600;
    font-size: 0.6rem;
}

.security-features li:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   13. Message Display
   ========================================================================== */
.message {
    margin-top: 12px;
    padding: 16px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: left;
    line-height: 1.5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.message.hidden {
    display: none;
}

.message.success {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border: 1px solid #34d399;
    text-align: center;
}

.message.error {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #7f1d1d;
    border: 1px solid #ef4444;
}

.message.info {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
    border: 1px solid #3b82f6;
    text-align: center;
}

/* Enhanced button styling within messages */
.message button {
    margin: 2px;
    transition: all 0.2s ease;
}

.message button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.message button:active {
    transform: translateY(0);
}

/* Field-level validation styles */
.form-group input.validating {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.form-group input.valid {
    border-color: var(--accent-green);
    background: rgba(16, 185, 129, 0.05);
}

.form-group input.invalid {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.field-validation-message {
    font-size: 0.8rem;
    margin-top: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    display: none;
}

.field-validation-message.error {
    color: #7f1d1d;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    display: block;
}

.field-validation-message.success {
    color: #065f46;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    display: block;
}

/* Password strength indicator and validation messages */
.password-strength-indicator {
    width: 100% !important;
    clear: both !important;
    display: block !important;
    margin-top: 8px !important;
    font-size: 0.8rem !important;
    line-height: 1.4 !important;
}

/* Password requirement styling */
.password-requirement-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: #374151;
}

.password-requirement-item {
    margin: 2px 0;
}

.password-requirement-item.met {
    color: #10b981;
}

.password-requirement-item.unmet {
    color: #6b7280;
}

/* Email exists dialog button styling */
.email-exists-buttons {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.email-exists-btn {
    padding: 8px 16px;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}

.email-exists-btn.sign-in {
    background: var(--accent-blue);
}

.email-exists-btn.forgot-password {
    background: var(--accent-green);
}

.email-exists-btn.different-email {
    background: #6b7280;
}

/* Ensure password validation messages appear below input */
.password-input-container + .field-validation-message,
.password-input-container + .password-strength-indicator {
    width: 100%;
    clear: both;
    display: block;
    margin-top: 6px;
}

/* Fix for password field validation messages */
.form-group .password-input-container ~ .field-validation-message {
    width: 100%;
    clear: both;
    display: block !important;
    margin-top: 6px;
}

/* ==========================================================================
   14. Animations
   ========================================================================== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   15. Mobile Responsive
   ========================================================================== */
/* ==========================================================================
   Responsive Design - Mobile First
   ========================================================================== */

/* Tablet Styles */
@media (max-width: 1024px) {
    .checkout-container {
        grid-template-columns: 1fr;
        gap: 32px;
        max-width: 600px;
    }

    .plan-column {
        position: static;
        order: -1;
    }

    .main-content {
        padding: 32px 20px;
    }
}

/* Mobile Landscape */
@media (max-width: 768px) {
    .header-container {
        padding: 12px 16px;
    }

    .logo h1 {
        font-size: 1.3rem;
    }

    .header-nav {
        gap: 16px;
    }

    .nav-link {
        font-size: 0.9rem;
        padding: 6px 10px;
    }

    .main-content {
        padding: 24px 16px;
    }

    .checkout-container {
        grid-template-columns: 1fr;
        gap: 24px;
        max-width: 500px;
    }

    .form-column {
        padding: 24px;
    }

    .form-header h2 {
        font-size: 1.75rem;
    }

    .form-header p {
        font-size: 0.95rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-group input,
    .form-group select {
        padding: 12px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .auth-button {
        padding: 14px 24px;
        font-size: 16px;
    }

    .plan-column {
        position: static;
        order: -1;
    }

    .plan-card {
        padding: 20px;
    }
    
    .security-notice {
        padding: 16px;
    }

    .optional-section {
        padding: 16px;
    }
}

/* Mobile Portrait */
@media (max-width: 480px) {
    .header-container {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }

    .logo h1 {
        font-size: 1.25rem;
    }

    .main-content {
        padding: 20px 12px;
    }

    .checkout-container {
        max-width: 100%;
    }

    .form-column {
        padding: 20px;
        border-radius: 12px;
    }

    .form-header h2 {
        font-size: 1.5rem;
    }

    .form-header p {
        font-size: 0.9rem;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .form-group input,
    .form-group select {
        padding: 12px 14px;
    }

    .auth-button {
        padding: 12px 20px;
        font-size: 15px;
    }

    .password-toggle {
        width: 32px;
        height: 32px;
        right: 8px;
        font-size: 1rem;
    }

    .password-input-container input {
        padding-right: 48px;
    }

    .plan-card {
        padding: 16px;
    }

    .security-notice {
        padding: 12px;
    }

    .optional-section {
        padding: 12px;
    }

    .password-strength-indicator {
        font-size: 0.75rem !important;
    }

    .form-options {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

/* Extra Small Mobile */
@media (max-width: 360px) {
    .main-content {
        padding: 16px 8px;
    }

    .form-column {
        padding: 16px;
    }

    .form-header h2 {
        font-size: 1.375rem;
    }

    .form-group input,
    .form-group select {
        padding: 10px 12px;
    }

    .password-toggle {
        width: 28px;
        height: 28px;
        right: 6px;
        font-size: 0.9rem;
    }

    .password-input-container input {
        padding-right: 40px;
    }

    .plan-card,
    .security-notice,
    .optional-section {
        padding: 12px;
    }
}

/* ==========================================================================
   16. Form Validation States
   ========================================================================== */
.form-group input.valid,
.form-group select.valid {
    border-color: var(--accent-green);
    background: rgba(16, 185, 129, 0.05);
}

.form-group input.invalid,
.form-group select.invalid {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.validation-error {
    color: #ef4444 !important;
    font-size: 0.8rem !important;
    margin-top: 4px !important;
    display: block;
    animation: fadeInError 0.3s ease;
}

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

.create-account-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.create-account-btn:disabled:hover {
    transform: none !important;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3) !important;
}

/* ==========================================================================
   17. Accessibility & High DPI
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .form-column,
    .plan-card,
    .security-notice {
        border-width: 0.5px;
    }
}
