/* signUpStyle.css */

/* Import Inter font to match the original clean look of the form */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Local variables mapped from navbarStyle.css where possible, 
       plus new ones for the form specific needs */
    --color-accent: var(--primary-color, #6f00ff); 
    --color-error: #ef4444;
    --color-success: #22c55e;
    --color-text-main: #1f2937;
    --color-text-muted: #544058;
    --color-border: #d1d5db;
    --color-bg-card: rgba(255, 255, 255, 0.5);
    
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* --- Page Layout --- */
.signup-page-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    font-family: 'Inter', sans-serif; /* Clean font for form readability */
}

/* --- Card Container --- */
.signup-card {
    width: 100%;
    max-width: 56rem; /* equivalent to max-w-4xl */
    padding: 1.5rem;
    background-color: var(--color-bg-card);
    backdrop-filter: blur(4px); /* backdrop-blur-sm */
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); /* shadow-2xl */
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .signup-card {
        padding: 2.5rem;
    }
}

/* --- Typography --- */
.signup-title {
    font-size: 1.875rem; /* text-3xl */
    font-weight: 700;
    color: var(--color-text-main);
    margin-bottom: 1.5rem;
    text-align: center;
}

.section-label {
    display: block;
    font-size: 0.875rem; /* text-sm */
    font-weight: 500;
    color: var(--color-text-main);
    margin-bottom: 0.25rem;
}

.required-star {
    color: var(--color-error);
}

.helper-text {
    font-size: 0.75rem; /* text-xs */
    margin-top: 0.25rem;
    color: var(--color-text-muted);
}

.error-text {
    color: var(--color-error);
    font-size: 0.875rem; /* text-sm */
    margin-top: 0.25rem;
    display: none; /* hidden by default */
}
.error-text.active {
    display: block;
}

/* --- Form Layouts --- */
.form-stack {
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* space-y-6 */
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .form-grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}
/* Mobile default for grid-3 is single column */
.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}


/* --- Inputs & Controls --- */
.form-control {
    display: block;
    width: 100%;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    padding: 0.75rem;
    color: #111827;
    background-color: white;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(111, 0, 255, 0.2); /* ring-accent-purple */
}

/* Input group wrapper */
.input-group-relative {
    position: relative;
}

/* NEW: Wrapper to hold Label (left) and Status Icon (right) together above the input */
.field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 0.25rem; /* Space between header and input */
}

/* Remove bottom margin from label when inside the header, as the header handles spacing */
.field-header .section-label {
    margin-bottom: 0;
}

/* MODIFIED: Reset positioning to sit naturally in the flow instead of floating */
.password-icon-container {
    position: static; 
    height: auto;
    padding-right: 0; 
    display: flex;
    align-items: center;
    pointer-events: auto;
    z-index: auto;
}

/* --- Terms & Policy Styles --- */
.terms-container {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
}

.terms-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--color-text-main);
}

.terms-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.1rem;
    accent-color: var(--color-accent);
    cursor: pointer;
}

.policy-link {
    color: var(--color-accent);
    font-weight: 600;
    text-decoration: none;
}

.policy-link:hover {
    text-decoration: underline;
}

.compare-link{
    color: var(--color-accent);
    font-weight: 600;
    text-decoration: none;
}

.compare-link:hover {
    text-decoration: underline;
}

/* --- Buttons --- */
.btn-primary {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    color: white;
    font-weight: 600;
    background-color: var(--color-accent);
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.btn-primary:hover {
    background-color: var(--color-pink, #f297be); /* Fallback if variable missing */
}

.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--color-accent);
}

.btn-modal {
    margin-top: 1.5rem;
    width: 100%;
    padding: 0.5rem;
    color: white;
    background-color: var(--color-accent); /* Defaulting to primary instead of blue for consistency */
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
}
.btn-modal:hover {
    background-color: var(--color-blue);
}


/* --- Password Strength & Requirements --- */
.requirements-box {
    padding: 1rem;
    border-radius: var(--radius-xl);
}

.req-title {
    font-weight: 600;
    color: var(--color-text-main);
    margin-bottom: 0.5rem;
}

.req-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
}

.req-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
    color: var(--color-error);
}

.req-item.valid {
    color: var(--color-success);
}

/* Lucide Icon sizing overrides */
.req-item i, .icon-alert {
    width: 16px;
    height: 16px;
    margin-right: 0.5rem;
}

.strength-box {
    padding: 1rem;
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

@media (min-width: 768px) {
    .strength-box {
        align-items: flex-start;
    }
}

.strength-display {
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0.75rem;
    border-radius: var(--radius-xl);
    min-width: 150px;
    text-align: center;
    color: #9ca3af;
    background-color: #f3f4f6;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0; /* top/right/bottom/left: 0 */
    background-color: rgba(75, 85, 99, 0.5); /* bg-gray-600 opacity-50 */
    display: flex; /* hidden toggled via JS class */
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 24rem; /* max-w-sm */
    width: 100%;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

/* Large modal for Terms/Privacy */
.modal-content.modal-lg {
    /* Mobile First Dimensions */
    width: 95%; 
    height: 90vh; 
    max-height: 90vh;
    padding: 0.5rem; /* Reduced from 1rem to maximize space */
    
    display: flex;
    flex-direction: column;
}

/* Desktop Overrides for modal-lg */
@media (min-width: 768px) {
    .modal-content.modal-lg {
        width: 90%; 
        max-width: 1000px; 
        padding: 2.5rem; /* Revert to large padding on desktop */
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.modal-body-iframe-wrapper {
    flex-grow: 1;
    width: 100%;
    overflow: hidden; 
    margin-bottom: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background-color: white;
    position: relative;
    display: flex;
}

.policy-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0.25rem;
    border-radius: var(--radius-md);
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background-color: #f3f4f6;
    color: var(--color-error);
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #dc2626; /* red-600 */
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

/* Utility to hide elements */
.hidden {
    display: none !important;
}

/* --- Subscription Plan Selection --- */
.plan-selection-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
}

@media (min-width: 768px) {
    .plan-selection-grid {
        flex-direction: row;
    }
}

.plan-option {
    position: relative;
    flex: 1;
    cursor: pointer;
}

/* Hide the default radio button */
.plan-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* The clickable card */
.plan-card-content {
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    background-color: white;
    transition: all 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.plan-option:hover .plan-card-content {
    border-color: #a78bfa; /* subtle hover effect */
}

/* Selected state styling */
.plan-option input[type="radio"]:checked + .plan-card-content {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(111, 0, 255, 0.15);
    background-color: #faf5ff; 
}

.plan-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.plan-title {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--color-text-main);
}

.plan-price {
    font-weight: 600;
    color: var(--color-accent);
}

/* Nebula Highlight Styling */
.plan-option.highlight {
    margin-top: 0.75rem; 
}

@media (min-width: 768px) {
    .plan-option.highlight {
        margin-top: 0; 
        transform: scale(1.03); /* Pops out slightly on desktop */
        z-index: 1;
    }
}

.recommended-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--color-pink, #f297be);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    z-index: 2;
    white-space: nowrap;
}

/* --- Mobile stacking for the Plan Selection Header --- */
@media (max-width: 767px) {
    .field-header.plan-header-wrap {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem; /* Adds a little breathing room between the label and the link */
    }
}

/* Tooltip CSS */
.tooltip-content {
    visibility: hidden;
    width: 250px;
    background-color: #1f2937; /* Dark background */
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 10;
    bottom: 125%; 
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.75rem;
    font-weight: normal;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%; 
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1f2937 transparent transparent transparent;
}

.tooltip-wrapper:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}