/* Hirly/styling/pages/page-auth.css */

/* Styles specific to Login and Signup pages - Enhanced for consistency */

/* Force overflow visible on potentially problematic parents */
html, body, .main.container, .auth-container, .multi-step-signup {
    overflow: visible !important;
}

.main.container {
    padding-top: var(--spacing-xxl); /* Consistent top padding for main content */
    padding-bottom: var(--spacing-xxl); /* Consistent bottom padding */
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align to top if content is short */
    min-height: calc(100vh - var(--header-height, 90px) - var(--footer-height, 200px)); /* Ensure content fills viewport */
}

.auth-container {
    background-color: var(--white);
    border-radius: var(--border-radius); /* Use consistent border-radius */
    box-shadow: var(--shadow-md); /* Use consistent shadow */
    padding: var(--spacing-xl); /* Generous padding */
    max-width: 500px; /* Slightly wider for better form layout */
    width: 100%; /* Ensure responsiveness */
    margin: 0 auto; /* Center with auto margins */
    text-align: center;
    border: 1px solid var(--border-color); /* Subtle border */
    position: relative; /* Establish stacking context for z-index */
    z-index: 1; /* Base z-index */
}

.auth-title h2 {
    font-size: var(--font-size-xxl); /* Larger title for prominence */
    color: var(--primary-dark);
    margin-bottom: var(--spacing-sm);
    font-weight: 700; /* Bolder title */
}

.auth-title p {
    color: var(--text-light);
    margin-bottom: var(--spacing-xl); /* More space below subtitle */
    font-size: var(--font-size-base); /* Consistent font size */
}

.auth-container .form-group {
    margin-bottom: var(--spacing-lg); /* Increased spacing between form groups */
    text-align: left; /* Align labels/inputs left */
}

.auth-container .form-control {
    margin-bottom: 0; /* Remove default form-control margin for better spacing within auth forms */
    padding: 0.9rem 1.2rem; /* Consistent padding for inputs */
    border-color: var(--gray); /* Consistent border color */
    border-radius: var(--radius-sm); /* Consistent border radius */
    font-size: var(--font-size-base); /* Consistent font size */
}

/* Specific for Auth links like "Forgot password?" */
.auth-container .text-sm {
    font-size: var(--font-size-sm);
    display: block; /* Make it block to take full width */
    margin-top: var(--spacing-xs);
    text-align: right;
    color: var(--text-light); /* Lighter text color */
}

.auth-footer {
    margin-top: var(--spacing-xl); /* More space above footer */
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color); /* Use consistent border color */
    font-size: var(--font-size-base);
}

.auth-footer p {
    margin-bottom: 0;
    color: var(--text-light);
}

.auth-footer a {
    font-weight: 500;
    color: var(--primary); /* Consistent link color */
}

/* Form Rows for Signup (First Name, Last Name) */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md); /* Add margin-bottom to the row */
}

.form-row .form-group {
    flex: 1; /* Allow items to grow */
    min-width: calc(50% - var(--spacing-md) / 2); /* Two columns on larger screens */
    margin-bottom: 0; /* Remove form-group margin inside row */
}

/* Phone Input Group */
.phone-input-group {
    display: flex;
    gap: var(--spacing-xs); /* Small gap between country code and phone number */
    align-items: center;
    width: 100%;
}

.phone-input-group .country-code-select {
    flex-shrink: 0; /* Prevent shrinking */
    width: auto; /* Allow content to dictate width */
    min-width: 90px;
    max-width: 120px;
    padding: 0.9rem 0.5rem;
    text-align: left;
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-base);
    color: var(--text-body);
    background-color: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236c757d'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.2em;
    padding-right: 2rem;
}

.phone-input-group .country-code-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
    outline: none;
}

.phone-input-group input[type="tel"] {
    flex-grow: 1; /* Allow phone number input to take remaining space */
}


/* Radio Group (User Type selection) */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-top: var(--spacing-sm);
}

.radio-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    cursor: pointer;
    font-size: var(--font-size-base);
    color: var(--text-body);
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    flex-grow: 1;
}

.radio-label:hover {
    background-color: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.radio-label input[type="radio"] {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.radio-label input[type="radio"]:checked + span {
    color: var(--primary-dark);
}

/* User Type Cards (Step 1) */
.user-type-cards {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    justify-content: center;
}

.user-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    flex-grow: 1;
    min-width: 200px;
    box-sizing: border-box;
    position: relative;
}

.user-type-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

/* FIX: Redesigned active state for user type cards */
.user-type-card.active {
    border-color: var(--primary);
    background-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.user-type-card.active .card-content h4,
.user-type-card.active .card-content p,
.user-type-card.active .card-content i {
    color: var(--primary-dark);
}

.user-type-card.active::before {
    content: "\f00c";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    top: 8px;
    right: 8px;
    color: var(--primary-dark);
    font-size: 1.2rem;
}

.user-type-card input[type="radio"] {
    display: none;
}


.user-type-card .card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
    padding: var(--spacing-sm);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.user-type-card .card-content i {
    color: var(--primary);
    margin-bottom: var(--spacing-xs);
}


.user-type-card .card-content h4 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-xs);
    color: var(--text-heading);
}

.user-type-card .card-content p {
    font-size: var(--font-size-sm);
    color: var(--text-body);
    margin-bottom: 0;
}

/* Progress Indicator */
.progress-indicator {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: var(--spacing-xl);
}

.step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--gray);
    transition: background-color 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}

.step-dot.active {
    background-color: var(--primary);
    transform: scale(1.2);
}

.step-dot.completed {
    background-color: var(--success);
}

/* Form Navigation Buttons */
.form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: var(--spacing-xl);
    gap: var(--spacing-md);
}

.form-navigation .btn {
    flex-grow: 1;
    padding: 0.75rem 1rem;
    font-size: var(--font-size-base);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Unified Profession Dropdown Styles */
.profession-search-container {
    padding: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 1;
}

.profession-search-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
}
.profession-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* FIX: New styles for the cascading dropdowns */
.categories-list, .professions-list {
    max-height: 250px;
    overflow-y: auto;
    padding: 0.5rem;
}

.categories-list .profession-item, .professions-list .profession-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
}

.categories-list .profession-item:hover, .professions-list .profession-item:hover {
    background-color: var(--primary-light);
}
/* Style the checkbox itself, not the parent */
.categories-list .profession-item input[type="checkbox"] {
    margin-right: 0; /* Remove margin to rely on flex gap */
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

.categories-list .profession-item .profession-icon {
    color: var(--primary);
    min-width: 20px;
    text-align: center;
    font-size: 1.2rem;
}

.categories-list .profession-item span, .professions-list .profession-item span {
    font-weight: 500;
    color: var(--text-dark);
}

/* Style for when a checkbox is checked */
.categories-list .profession-item input[type="checkbox"]:checked ~ .profession-icon,
.categories-list .profession-item input[type="checkbox"]:checked ~ span {
    color: var(--primary-dark);
}
.categories-list .profession-item input[type="checkbox"]:checked {
    background-color: var(--primary);
}


/* Dropdown Toggle and Menu */
.custom-dropdown {
    position: relative;
    width: 100%;
    overflow: visible !important;
}

.dropdown-toggle {
    width: 100%;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    color: var(--text-dark);
}

.dropdown-toggle:hover {
    border-color: var(--primary);
}

.custom-dropdown.active .dropdown-toggle {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    max-height: 250px;
    overflow-y: auto;
    padding-bottom: 1rem;
}

.custom-dropdown.active .dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-arrow {
    transition: transform 0.2s;
    font-size: var(--font-size-sm);
    color: var(--text-light);
}

.custom-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* Selected Tags */
.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.selected-tag {
    background: var(--primary-light);
    color: var(--primary);
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
}

.remove-tag {
    cursor: pointer;
    color: var(--primary);
    display: flex;
    align-items: center;
}

.remove-tag:hover {
    opacity: 0.8;
}

/* Search Input */
.profession-search-container {
    padding: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 1;
}

.profession-search-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
}

.profession-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.no-results {
    text-align: center;
    color: var(--text-light);
    padding: var(--spacing-md);
    font-size: var(--font-size-sm);
}

/* Loading Spinner Styles */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-left: 6px;
    flex-shrink: 0;
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Message Box Colors */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }

.message-box.info {
    background-color: var(--info-light, #e0f2f7);
    color: var(--info-dark, #007bff);
    border: 1px solid var(--info, #007bff);
}

/* NEW STYLES FOR MULTI-STEP SIGNUP */
.multi-step-signup {
    padding: var(--spacing-xl);
    max-width: 600px;
    position: relative;
    z-index: 2;
}

.multi-step-form {
    position: relative;
}

.signup-step {
    display: none;
    animation: fadeIn 0.5s ease-out;
    overflow: visible;
}

.signup-step.active {
    display: block;
}

.step-heading {
    font-size: var(--font-size-xl);
    color: var(--primary-dark);
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
}

.step-description {
    color: var(--text-light);
    margin-bottom: var(--spacing-lg);
    font-size: var(--font-size-base);
}

.sub-heading {
    font-size: var(--font-size-lg);
    color: var(--primary);
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
    font-weight: 600;
    text-align: left;
}

/* User Type Cards (Step 1) */
.user-type-cards {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    justify-content: center;
}

.user-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    flex-grow: 1;
    min-width: 200px;
    box-sizing: border-box;
    position: relative;
}

.user-type-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.user-type-card.active {
    border-color: var(--primary);
    background-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.user-type-card.active .card-content h4,
.user-type-card.active .card-content p,
.user-type-card.active .card-content i {
    color: var(--primary-dark);
}

.user-type-card.active::before {
    content: "\f00c";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    top: 8px;
    right: 8px;
    color: var(--primary-dark);
    font-size: 1.2rem;
}

.user-type-card input[type="radio"] {
    display: none;
}


.user-type-card .card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
    padding: var(--spacing-sm);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.user-type-card .card-content i {
    color: var(--primary);
    margin-bottom: var(--spacing-xs);
}


.user-type-card .card-content h4 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-xs);
    color: var(--text-heading);
}

.user-type-card .card-content p {
    font-size: var(--font-size-sm);
    color: var(--text-body);
    margin-bottom: 0;
}

/* Progress Indicator */
.progress-indicator {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: var(--spacing-xl);
}

.step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--gray);
    transition: background-color 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}

.step-dot.active {
    background-color: var(--primary);
    transform: scale(1.2);
}

.step-dot.completed {
    background-color: var(--success);
}

/* Form Navigation Buttons */
.form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: var(--spacing-xl);
    gap: var(--spacing-md);
}

.form-navigation .btn {
    flex-grow: 1;
    padding: 0.75rem 1rem;
    font-size: var(--font-size-base);
    display: flex;
    justify-content: center;
    align-items: center;
}
