/* Step1 (Signup/Login) Page Styles */

body {
    width: 100%;
    height: 100dvh;
    background: linear-gradient(0deg, rgba(139, 201, 236, 0) 0%, #0082ca 50%);
    background-size: cover;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    opacity: 0.1;
    background-image: url('/images/tool_bg.svg');
    background-size: cover;
    z-index: -2;
}

body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image: url('/images/illustration.svg');
    background-size: cover;
    opacity: 0;
    z-index: -1;
}

/* Container Row - Fixed Height */
.container-fluid .row {
    min-height: 100vh;
    align-items: flex-start;
    padding-top: 80px;
}

/* Hero Section */
.hero-section {
    color: white;
    padding: 60px 0;
    margin-left: 6rem;
    position: sticky;
    top: 80px;
    align-self: flex-start;
}

.logo {
    max-width: 300px;
    width: 100%;
    height: auto;
    background-size: cover;
    margin-bottom: 30px;
    display: block;
}

.hero-title {
    max-width: 505px;
    width: 100%;
    font-family: Arial;
    font-weight: bold;
    font-size: 2.25rem;
    color: #ffffff;
    text-decoration: none solid rgb(255, 255, 255);
    line-height: 1.2;
    letter-spacing: -1px;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: bold;
    opacity: 0.9;
    margin-bottom: 1rem;
    max-width: 100%;
}

/* Signup Card */
.signup-card {
    max-width: 580px;
    width: 100%;
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative; 
    overflow: hidden; 
    margin-top: 80px;
}

/* Form Controls */
.form-control, .form-select {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.row .col-md-6 .form-control,
.row .col-md-6 .form-select {
    margin-bottom: 15px;
}

.row {
    margin-bottom: 10px;
}

.form-control:focus, .form-select:focus {
    border-color: #4caf50;
    box-shadow: 0 0 0 0.2rem rgba(76, 175, 80, 0.25);
}

/* Buttons */
.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: #45a049;
    text-decoration: underline;
    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: #4caf50;
    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: #45a049;
    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 */
.auth-section {
    position: relative; /* For loading overlay positioning */
}

.auth-section h4 {
    color: #333;
    font-weight: 600;
}

.auth-section h5 {
    color: #666;
    font-weight: 500;
}

.text-danger {
    font-size: 0.8rem;
    margin-top: -15px;
    margin-bottom: 15px;
}

/* Tab Switcher Styles */
.auth-tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 30px;
}

.auth-tab {
    background: none;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    color: #999;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.auth-tab:hover {
    color: #4caf50;
}

.auth-tab.active {
    color: #4caf50;
    border-bottom-color: #4caf50;
}

/* Content Sections */
.auth-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.auth-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-switch {
    color: #4caf50;
    font-weight: 600;
    text-decoration: none;
}

.auth-switch:hover {
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 991px) {
    .container-fluid {
        min-height: 0vh;
        align-items: flex-start;
        padding-top: 0px;
    }

    .container-fluid .row {
        min-height: auto;
        padding-top: 20px;
        align-items: flex-start;
    }

    .hero-section {
        margin-left: 0;
        padding: 20px 15px;
        position: relative;
        top: auto;
    }

    /* Remove vertical centering on mobile */
    .col-lg-4.d-flex.align-items-center {
        align-items: flex-start !important;
    }

    .signup-card {
        margin-top: 15px;
        padding: 30px;
        margin-left: 15px;
        margin-right: 15px;
    }
}

@media (max-width: 767px) {
    body {
        padding: 0;
        margin: 0;
        font-size: 16px;
    }

    .container-fluid .row {
        padding-top: 20px;
    }

    .hero-section {
        margin-left: 0;
        padding: 10px 15px;
        text-align: center;
    }

    .logo {
        max-width: 250px;
        margin-bottom: 15px;
        display: block;
        margin-left: auto;
        margin-right: auto;
    }

    .hero-title {
        font-size: 1.8rem;
        line-height: 1.3;
        max-width: 100%;
    }

    .hero-subtitle {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }

    .signup-card {
        margin-top: 10px;
        margin-bottom: 20px;
        margin-left: 10px;
        margin-right: 10px;
        padding: 25px 20px;
        border-radius: 8px;
    }

    /* Mobile-friendly form elements */
    .form-control,
    .form-select {
        font-size: 16px !important;
        padding: 12px 14px !important;
        min-height: 48px !important;
    }

    .form-label {
        font-size: 1rem !important;
        margin-bottom: 8px !important;
    }

    .btn {
        font-size: 1rem !important;
        padding: 14px 20px !important;
        min-height: 48px !important;
    }

    .auth-section h4 {
        font-size: 1.4rem !important;
    }

    .auth-section p,
    .text-muted {
        font-size: 1rem !important;
    }
}

@media (max-width: 480px) {
    .container-fluid .row {
        padding-top: 8px;
    }

    .hero-section {
        padding: 8px 10px;
    }

    .logo {
        max-width: 200px;
        margin-bottom: 10px;
    }

    .hero-title {
        font-size: 1.5rem;
        letter-spacing: -0.5px;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 0.3rem;
    }

    .signup-card {
        margin-top: 8px;
        margin-left: 5px;
        margin-right: 5px;
        padding: 20px 15px;
    }

    .auth-tab {
        padding: 12px 20px;
        font-size: 1rem;
    }

    .auth-tabs {
        margin-bottom: 20px;
    }

    /* Password requirements readable on mobile */
    .password-requirements .requirement {
        font-size: 0.9rem !important;
    }

    /* OTP inputs touch-friendly */
    .otp-input {
        width: 46px !important;
        height: 52px !important;
        font-size: 1.4rem !important;
    }
}

@media (max-width: 430px) and (max-height: 932px) {
    .hero-section {
        padding: 10px 8px;
    }

    body {
        min-height: 100dvh;
    }
}

/* ========== OTP FLOW STYLES ========== */

/* Phase Management */
.otp-phase {
    display: none;
    animation: fadeIn 0.4s ease-in;
    position: relative;
}

.otp-phase.active {
    display: block;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border-radius: 12px;
}

/* OTP Input Container */
.otp-input-container {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 20px 0;
}

.otp-input {
    width: 50px;
    height: 50px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: #f8f9fa;
}

.otp-input:focus {
    outline: none;
    border-color: #4caf50;
    background: white;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.otp-input.error {
    border-color: #dc3545;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Password Requirements Checklist */
.password-requirements {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
}

.requirement {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.requirement i {
    font-size: 0.5rem;
    transition: all 0.2s ease;
}

.requirement.met {
    color: #28a745;
}

.requirement.met i {
    color: #28a745;
}

/* Password Match Indicator */
.password-match-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    margin-top: 8px;
}

.password-match-indicator.show {
    display: flex;
}

.password-match-indicator.match {
    color: #28a745;
}

.password-match-indicator.no-match {
    color: #dc3545;
}

/* Success Icon Animation */
.success-icon i {
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Input Group (Password Toggle) */
.input-group .form-control {
    margin-bottom: 0;
    border-right: none;
}

.input-group .form-control:focus {
    border-color: #4caf50;
    box-shadow: none;
}

.input-group .btn-outline-secondary {
    border-left: none;
    border-color: #ddd;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
}

.input-group .btn-outline-secondary:hover {
    background-color: #f8f9fa;
    border-color: #ddd;
    color: #333;
}

.input-group .btn-outline-secondary:focus {
    box-shadow: none;
    border-color: #ddd;
}

.input-group:focus-within .btn-outline-secondary {
    border-color: #4caf50;
}

.input-group:focus-within .form-control {
    border-color: #4caf50;
}

/* Button States */
.btn-success {
    background-color: #28a745;
    border: none;
    padding: 12px 0;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

.btn-success:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-success:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-success:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.btn-outline-secondary {
    border-color: #6c757d;
    color: #6c757d;
}

.btn-outline-secondary:hover {
    background-color: #6c757d;
    color: white;
}

.btn-link {
    color: #4caf50;
    text-decoration: none;
}

.btn-link:hover {
    text-decoration: underline;
    color: #45a049;
}

.btn-link:disabled {
    color: #6c757d;
    cursor: not-allowed;
}

/* Error Styling */
.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.invalid-feedback {
    display: none;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 4px;
}

.is-invalid {
    border-color: #dc3545 !important;
}

.is-invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.is-invalid ~ .invalid-feedback {
    display: block;
}

/* Mobile Responsive - OTP Specific */
@media (max-width: 480px) {
    .otp-input {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }

    .otp-input-container {
        gap: 6px;
    }

    .password-requirements {
        font-size: 0.8rem;
    }
}

@media (max-width: 380px) {
    .otp-input {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .otp-input-container {
        gap: 4px;
    }
}
