/* Shared layout primitives for signup flow: Step1, Step2, Step3, Processing */

:root {
    --signup-card-radius: 16px;
    --signup-card-radius-sm: 12px;
    --signup-card-max-width: 600px;
    --signup-card-padding: 40px;
    --signup-card-padding-md: 30px;
    --signup-card-padding-sm: 25px 20px;
    --signup-card-padding-xs: 20px 15px;
    --signup-card-margin-top: 80px;
    --signup-card-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    --signup-primary: #4caf50;
    --signup-primary-hover: #45a049;
    --signup-bg-gradient: linear-gradient(0deg, rgba(139, 201, 236, 0) 0%, #0082ca 50%);
}

/* Body: dynamic viewport with vh fallback for older browsers */
body {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--signup-bg-gradient);
    background-size: cover;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    position: relative;
    margin: 0;
    padding: 0;
}

body::before,
body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    pointer-events: none;
}

body::before {
    opacity: 0.1;
    background-image: url('/images/tool_bg.svg');
    z-index: -2;
}

body::after {
    opacity: 0;
    background-image: url('/images/illustration.svg');
    z-index: -1;
}

/* Container: top padding consistent across pages */
.container-fluid {
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: 80px;
}

@media (max-width: 991px) {
    .container-fluid {
        padding-top: 24px;
    }
}

@media (max-width: 767px) {
    .container-fluid {
        padding-top: 12px;
    }
}

/* Hero section: same offset, same breakpoints, no sticky */
.hero-section {
    color: white;
    padding: 60px 0;
    margin-left: 6rem;
}

.hero-section h1,
.hero-section .hero-title {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
    color: #ffffff;
    max-width: 505px;
}

.hero-section h4 {
    margin-bottom: 1rem;
}

.hero-section p,
.hero-section .hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.logo {
    max-width: 300px;
    width: 100%;
    height: auto;
    margin-bottom: 30px;
    display: block;
}

@media (max-width: 991px) {
    .hero-section {
        margin-left: 2rem;
        padding: 30px 0;
    }

    .hero-section h1,
    .hero-section .hero-title {
        font-size: 2rem;
    }
}

@media (max-width: 767px) {
    .hero-section {
        margin-left: 0;
        padding: 20px 15px;
        text-align: center;
    }

    .hero-section h1,
    .hero-section .hero-title {
        font-size: 1.8rem;
        max-width: 100%;
    }

    .hero-section p,
    .hero-section .hero-subtitle {
        font-size: 1.1rem;
    }

    .logo {
        max-width: 250px;
        margin-bottom: 20px;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 12px 10px;
    }

    .hero-section h1,
    .hero-section .hero-title {
        font-size: 1.5rem;
        letter-spacing: -0.5px;
    }

    .hero-section p,
    .hero-section .hero-subtitle {
        font-size: 1rem;
    }

    .logo {
        max-width: 200px;
        margin-bottom: 15px;
    }
}

/* Signup card: one spec for all four pages */
.signup-card {
    background: white;
    border-radius: var(--signup-card-radius);
    padding: var(--signup-card-padding);
    box-shadow: var(--signup-card-shadow);
    margin-top: var(--signup-card-margin-top);
    max-width: var(--signup-card-max-width);
    width: 100%;
    position: relative;
}

@media (max-width: 991px) {
    .signup-card {
        margin-top: 32px;
        padding: var(--signup-card-padding-md);
        margin-left: 15px;
        margin-right: 15px;
    }
}

@media (max-width: 767px) {
    .signup-card {
        margin-top: 16px;
        margin-bottom: 20px;
        margin-left: 12px;
        margin-right: 12px;
        padding: var(--signup-card-padding-sm);
        border-radius: var(--signup-card-radius-sm);
    }
}

@media (max-width: 480px) {
    .signup-card {
        margin-left: 8px;
        margin-right: 8px;
        padding: var(--signup-card-padding-xs);
    }
}

/* Form & button mobile safeguards: 16px prevents iOS zoom; 48px = WCAG touch target */
.form-control,
.form-select {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--signup-primary);
    box-shadow: 0 0 0 0.2rem rgba(76, 175, 80, 0.25);
}

@media (max-width: 767px) {
    .form-control,
    .form-select {
        font-size: 16px !important;
        min-height: 48px !important;
    }

    .btn {
        font-size: 1rem !important;
        padding: 14px 20px !important;
        min-height: 48px !important;
    }
}

/* Step indicator: shared across Step2/Step3/Processing */
.step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.step {
    display: flex;
    align-items: center;
    margin: 0 20px;
    font-size: 0.9rem;
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    font-weight: bold;
    font-size: 0.9rem;
}

.step.active .step-number,
.step.completed .step-number {
    background-color: var(--signup-primary);
    color: white;
}

.step:not(.active):not(.completed) .step-number {
    background-color: #e0e0e0;
    color: #999;
}

.step:not(.active):not(.completed) .step-text {
    color: #999;
}

@media (max-width: 767px) {
    .step-indicator {
        flex-wrap: wrap;
        gap: 5px;
    }

    .step {
        margin: 0 5px;
        font-size: 0.75rem;
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 575px) {
    .step-text {
        font-size: 0.7rem;
        margin-top: 3px;
    }
}

/* Shared signout link (Step2, Step3, Processing) */
.signout-link {
    position: absolute;
    top: 20px;
    right: 20px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
    z-index: 10;
}

.signout-link:hover {
    color: white;
    text-decoration: underline;
}

.signout-link i {
    margin-left: 5px;
}

/* Shared button styles */
.btn-primary {
    background-color: #3cb54c;
    border: none;
    padding: 12px 0;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

.btn-primary:hover {
    background-color: var(--signup-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background-color: var(--signup-primary);
    border: none;
    color: white;
    padding: 12px 0;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

.btn-secondary:hover {
    background-color: var(--signup-primary-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Auth section base */
.auth-section {
    position: relative;
}

.auth-section h4 {
    color: #333;
    font-weight: 600;
}

/* Shared alerts */
.alert {
    padding: 12px 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.95rem;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}
