/* ==========================================
   SiteRooster Sign-Up Page
   Self-hosted checkout with Stripe Elements
   ========================================== */

:root {
    --siterooster-orange: #ff6b47;
    --siterooster-coral: #ff8a73;
    --siterooster-dark: #2a1810;
    --siterooster-cream: #fef7f3;
    --siterooster-light: #fff9f7;
    
    --status-green: #10b981;
    --status-green-bg: #ecfdf5;
    --status-red: #ef4444;
    --status-red-bg: #fef2f2;
    --status-blue: #3b82f6;
    --status-blue-bg: #eff6ff;
    
    --stripe-purple: #635bff;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
    
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
}

/* ==========================================
   Page Container
   ========================================== */
.siterooster-signup {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding-left: calc(50vw - 50%);
    padding-right: calc(50vw - 50%);
    background: linear-gradient(180deg, var(--siterooster-cream) 0%, #ffffff 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    box-sizing: border-box;
}

.siterooster-signup * {
    box-sizing: border-box;
}

/* Hide WordPress elements */
.siterooster-signup ~ *,
.entry-title,
.page-title,
.wp-block-post-title,
.entry-content > *:not(.siterooster-signup) {
    display: none !important;
}

/* ==========================================
   Sign-Up Container (wider than login)
   ========================================== */
.signup-container {
    width: 100%;
    max-width: 480px;
    background: white;
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

/* ==========================================
   Logo
   ========================================== */
.signup-logo {
    text-align: center;
    margin-bottom: 32px;
}

.signup-logo img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

/* ==========================================
   Header
   ========================================== */
.signup-header {
    text-align: center;
    margin-bottom: 28px;
}

.signup-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--siterooster-dark);
    margin: 0 0 8px 0;
}

.signup-header p {
    font-size: 16px;
    color: var(--gray-500);
    margin: 0;
}

/* ==========================================
   Error State (Invalid Plan)
   ========================================== */
.signup-error-state {
    text-align: center;
    padding: 20px 0;
}

.signup-error-state .error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.signup-error-state h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--siterooster-dark);
    margin: 0 0 12px 0;
}

.signup-error-state p {
    font-size: 15px;
    color: var(--gray-500);
    margin: 0 0 24px 0;
    line-height: 1.5;
}

.signup-error-state .btn {
    display: inline-block;
    width: auto;
    padding: 14px 28px;
}

/* ==========================================
   Plan Summary Card
   ========================================== */
.plan-summary-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
}

.plan-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.plan-summary-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--siterooster-dark);
}

.plan-change-link {
    font-size: 14px;
    color: var(--siterooster-orange);
    text-decoration: none;
}

.plan-change-link:hover {
    text-decoration: underline;
}

.plan-summary-price {
    margin-bottom: 12px;
}

.plan-summary-price .price-amount {
    font-size: 32px;
    font-weight: 700;
    color: var(--siterooster-dark);
}

.plan-summary-price .price-period {
    font-size: 15px;
    color: var(--gray-500);
}

.plan-summary-price .price-monthly-equiv {
    font-size: 13px;
    color: var(--gray-400);
    margin-top: 4px;
}

/* Discounted price styling */
.plan-summary-price .price-original {
    font-size: 20px;
    color: var(--gray-400);
    text-decoration: line-through;
    margin-right: 10px;
}

.plan-summary-price .price-discounted {
    font-size: 32px;
    font-weight: 700;
    color: var(--status-green);
}

.plan-summary-features {
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.6;
}

.plan-summary-features .feature-item {
    color: var(--gray-600);
}

.plan-summary-features .feature-separator {
    color: var(--gray-300);
    margin: 0 6px;
}

/* ==========================================
   Coupon Banner
   ========================================== */
.coupon-banner {
    background: var(--status-green-bg);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.coupon-banner .coupon-icon {
    font-size: 18px;
}

.coupon-banner .coupon-text {
    font-size: 14px;
    color: var(--status-green);
}

.coupon-banner .coupon-text strong {
    font-weight: 600;
}

/* Coupon Loading */
.coupon-loading {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--gray-500);
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid var(--gray-200);
    border-top-color: var(--siterooster-orange);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ==========================================
   Messages
   ========================================== */
.signup-message {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 24px;
    text-align: center;
}

.signup-message.error {
    background: var(--status-red-bg);
    color: var(--status-red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.signup-message.success {
    background: var(--status-green-bg);
    color: var(--status-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* ==========================================
   Form
   ========================================== */
.signup-form {
    margin-bottom: 16px;
}

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

.form-group label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 500;
    color: var(--siterooster-dark);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: var(--gray-50);
    color: var(--siterooster-dark);
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--siterooster-orange);
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 107, 71, 0.1);
}

.form-group input::placeholder {
    color: var(--gray-400);
}

/* Secure Badge in Label */
.secure-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    color: var(--status-green);
    background: var(--status-green-bg);
    padding: 3px 8px;
    border-radius: 4px;
}

.secure-badge .lock-icon {
    width: 12px;
    height: 12px;
}

/* Password input with toggle */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 60px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-500);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
}

.password-toggle:hover {
    color: var(--siterooster-orange);
}

/* Password strength indicator */
.password-strength,
.password-match {
    font-size: 12px;
    margin-top: 6px;
    min-height: 18px;
}

/* ==========================================
   Stripe Card Element
   ========================================== */
.card-element-wrapper {
    padding: 14px 16px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: var(--gray-50);
    transition: all 0.2s ease;
}

.card-element-wrapper:focus-within {
    border-color: var(--siterooster-orange);
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 107, 71, 0.1);
}

#card-element {
    min-height: 24px;
}

.card-errors {
    font-size: 13px;
    color: var(--status-red);
    margin-top: 8px;
    min-height: 20px;
}

/* ==========================================
   Trust Section
   ========================================== */
.trust-section {
    margin-top: 16px;
    margin-bottom: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-100);
}

.powered-by-stripe {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 12px;
}

.powered-by-stripe .powered-text {
    font-size: 12px;
    color: var(--gray-400);
}

.powered-by-stripe .stripe-logo {
    height: 18px;
    width: auto;
}

.security-features {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.security-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--gray-500);
}

.security-item .security-icon {
    color: var(--status-green);
}

/* ==========================================
   Buttons
   ========================================== */
.btn {
    display: block;
    width: 100%;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--siterooster-orange) 0%, var(--siterooster-coral) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(255, 107, 71, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 107, 71, 0.4);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: white;
    color: var(--siterooster-dark);
    border: 1px solid var(--gray-200);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

/* Submit button with lock icon */
.btn-submit {
    margin-top: 8px;
}

.btn-submit .btn-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-submit .btn-lock-icon {
    width: 16px;
    height: 16px;
}

.btn-submit .btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-submit .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================
   Guarantee Text
   ========================================== */
.guarantee-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 16px;
    text-align: center;
}

.guarantee-text .guarantee-icon {
    color: var(--status-green);
    flex-shrink: 0;
}

/* ==========================================
   Terms Text
   ========================================== */
.terms-text {
    font-size: 12px;
    color: var(--gray-500);
    text-align: center;
    margin-top: 16px;
    line-height: 1.5;
}

.terms-text a {
    color: var(--siterooster-orange);
    text-decoration: none;
}

.terms-text a:hover {
    text-decoration: underline;
}

/* ==========================================
   Divider
   ========================================== */
.signup-divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.signup-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gray-200);
}

.signup-divider span {
    position: relative;
    background: white;
    padding: 0 16px;
    font-size: 13px;
    color: var(--gray-400);
}

/* ==========================================
   Footer
   ========================================== */
.signup-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-100);
}

.signup-footer a {
    font-size: 14px;
    color: var(--gray-500);
    text-decoration: none;
}

.signup-footer a:hover {
    color: var(--siterooster-orange);
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 520px) {
    .signup-container {
        padding: 32px 24px;
    }
    
    .signup-header h1 {
        font-size: 24px;
    }
    
    .signup-logo img {
        width: 64px;
        height: 64px;
    }
    
    .plan-summary-card {
        padding: 16px;
    }
    
    .plan-summary-price .price-amount,
    .plan-summary-price .price-discounted {
        font-size: 28px;
    }
    
    .plan-summary-features {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    
    .plan-summary-features .feature-separator {
        display: none;
    }
    
    .security-features {
        flex-direction: column;
        gap: 8px;
    }
    
    .guarantee-text {
        flex-direction: column;
        gap: 4px;
    }
}