/**
 * IntelliRealty Registration Styles
 * Version: 1.3.1
 */

.ir-registration-wrapper {
    max-width: 700px;
    margin: 40px auto;
    padding: 0 20px;
}

.ir-registration-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 40px;
}

.ir-registration-container h2 {
    margin: 0 0 10px;
    font-size: 28px;
    font-weight: 600;
    color: #212529;
    text-align: center;
}

.ir-subtitle {
    text-align: center;
    color: #6c757d;
    margin-bottom: 30px;
    font-size: 14px;
}

/* User Type Selector */
.ir-user-type-selector {
    margin-bottom: 30px;
}

.ir-user-types {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.ir-user-type-card {
    position: relative;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ir-user-type-card:hover {
    border-color: #0666E6;
    background: #f8f9fa;
}

.ir-user-type-card.active {
    border-color: #0666E6;
    background: #e7f1ff;
}

.ir-user-type-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ir-type-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ir-type-icon {
    font-size: 32px;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 72px;
}

.ir-type-icon img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.ir-type-title {
    font-weight: 600;
    color: #212529;
    font-size: 16px;
}

.ir-type-desc {
    font-size: 12px;
    color: #6c757d;
}

/* Form Sections */
.ir-registration-container .ir-form-section {
    margin-bottom: var(--ir-space-3);
    padding: 0 !important;
    padding-bottom: var(--ir-space-3) !important;
    border-bottom: 1px solid #dee2e6;
}

.ir-registration-container .ir-form-section:last-of-type {
    border-bottom: none;
}

.ir-registration-container .ir-form-section h3 {
    margin: 0 0 var(--ir-space-3);
    font-size: 20px;
    font-weight: 600;
    color: #212529;
}

/* ====================================
   FORM LAYOUTS - Using global ir-components.css
   ==================================== */
/* Base .ir-form-group defined in ir-components.css */

/* Override global input padding for registration/login forms */
.ir-registration-container .ir-input,
.ir-registration-container input[type="text"],
.ir-registration-container input[type="email"],
.ir-registration-container input[type="password"],
.ir-registration-container input[type="tel"],
.ir-registration-container select {
    padding: 10px 16px;
}


.ir-help-text {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #6c757d;
}

/* Base .ir-form-row defined in ir-components.css */

.ir-form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ir-form-options .ir-link {
    margin-left: auto;
    white-space: nowrap;
}

/* ====================================
   CHECKBOX COMPONENTS - Using global ir-components.css
   ==================================== */
/* Base .ir-checkbox-group, .ir-checkbox-label defined in ir-components.css */

/* Languages Checkboxes */
.ir-registration-container .ir-languages-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.ir-registration-container .ir-language-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

.ir-registration-container .ir-language-checkbox:hover {
    border-color: #0666e6;
    background: #f0f7ff;
}

.ir-registration-container .ir-language-checkbox:has(input:checked) {
    border-color: #0666e6;
    background: #f0f7ff;
}

.ir-registration-container .ir-language-checkbox input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: #0666e6;
}

.ir-registration-container .ir-language-checkbox .ir-language-flag {
    font-size: 18px;
    line-height: 1;
}

.ir-registration-container .ir-language-checkbox .ir-language-name {
    font-weight: 500;
    color: #374151;
}

/* Remove margin from radio groups in registration */
.ir-registration-container .ir-radio-group {
    margin-bottom: 0;
}

/* Buttons - Now using global ir-components.css */
/* Module-specific button overrides can go here if needed */

/* Add spacing to login button */
.ir-login-form .ir-btn[type="submit"] {
    margin-top: 20px;
}

/* ====================================
   MESSAGES - Use .ir-alert from ir-components.css
   ==================================== */
/* Use .ir-alert, .ir-alert-success, .ir-alert-error instead of .ir-form-message */

/* ====================================
   NOTICE MESSAGES - Using global ir-components.css
   ==================================== */
/* Base .ir-notice system defined in ir-components.css */

/* Form Footer */
.ir-form-footer {
    margin-top: 20px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.ir-form-footer p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

.ir-form-footer a,
.ir-link {
    color: #0666E6;
    text-decoration: none;
    font-weight: 500;
}

.ir-form-footer a:hover,
.ir-link:hover {
    text-decoration: underline;
}

/* Loading State */
.ir-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

.ir-form.loading .ir-btn::after {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: ir-spin 0.6s linear infinite;
}

/* Animation defined in ir-components.css */

/* Responsive */
@media (max-width: 768px) {
    .ir-registration-wrapper {
        max-width: 100%;
        padding: 0;
        margin: 20px auto;
    }

    .ir-registration-container {
        padding: 30px 20px;
    }

    .ir-user-types {
        grid-template-columns: 1fr;
    }

    /* Make all inputs full width - one per row */
    .ir-registration-container .ir-form-row {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
        margin-bottom: 0 !important;
    }

    .ir-registration-container .ir-form-row .ir-form-group {
        margin-bottom: var(--ir-space-4) !important;
    }

    /* Override dashboard padding for registration form sections */
    .ir-registration-container .ir-form-section {
        padding: 0 !important;
        margin-bottom: var(--ir-space-3) !important;
        padding-bottom: var(--ir-space-3) !important;
    }

    .ir-form-options {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .ir-form-options .ir-link {
        margin-left: auto;
    }
}

/* ============================================
   COMBINED AUTH FORMS (Login + Forgot Password)
   ============================================ */

.ir-auth-container {
    position: relative;
    min-height: 450px;
    overflow: hidden;
}

.ir-auth-form {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-30px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.ir-auth-form.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
    position: relative;
}

.ir-toggle-forgot,
.ir-toggle-login {
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.ir-toggle-forgot:hover,
.ir-toggle-login:hover {
    opacity: 0.8;
    transform: translateX(2px);
}

.ir-toggle-login:hover {
    transform: translateX(-2px);
}

/* Loading state during transition */
.ir-auth-container.transitioning .ir-auth-form {
    pointer-events: none;
}

/* Smooth form inputs */
.ir-auth-form .ir-input {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.ir-auth-form .ir-input:focus {
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Success message styling */
.ir-auth-form .ir-form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    animation: slideDown 0.4s ease;
}

.ir-auth-form .ir-form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments for combined forms */
@media (max-width: 768px) {
    .ir-auth-container {
        min-height: auto;
        overflow: visible;
    }

    .ir-auth-form {
        transform: translateX(-20px);
        position: static;
    }

    .ir-auth-form:not(.active) {
        display: none;
    }

    .ir-auth-form.active {
        display: block;
        position: static;
        transform: translateX(0);
    }
}

/* Agent Hero Section */
.ir-agent-hero {
    text-align: center;
    padding: 40px 20px 50px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.ir-agent-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #e7f1ff 0%, #f0f7ff 100%);
    border-radius: 50%;
    margin: 0 auto 30px;
    box-shadow: 0 4px 16px rgba(6, 102, 230, 0.08);
    transition: all 0.3s ease;
}

.ir-agent-icon-wrapper:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(6, 102, 230, 0.15);
}

.ir-agent-icon {
    width: 56px;
    height: 56px;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(28%) sepia(93%) saturate(2463%) hue-rotate(209deg) brightness(96%) contrast(96%);
}

.ir-become-agent-title {
    font-family: inherit;
    font-size: 28px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px;
    letter-spacing: -0.5px;
}

.ir-become-agent-subtitle {
    font-family: inherit;
    font-size: 15px;
    font-weight: 400;
    color: #64748b;
    margin: 0;
    line-height: 1.6;
}

/* Thank You Modal */
.ir-thank-you-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ir-thank-you-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.ir-thank-you-container {
    position: relative;
    z-index: 100000;
    width: 90%;
    max-width: 600px;
}

.ir-thank-you-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 50px 40px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: thankYouSlideIn 0.3s ease-out;
}

@keyframes thankYouSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ir-thank-you-logo {
    margin-bottom: 30px;
}

.ir-thank-you-logo img {
    max-width: 250px;
    height: auto;
}

.ir-thank-you-title {
    font-family: inherit;
    font-size: 36px;
    font-weight: 700;
    color: #0666E6;
    margin: 0 0 20px;
}

.ir-thank-you-message {
    font-family: inherit;
    font-size: 18px;
    line-height: 1.7;
    color: #212529;
    margin: 0 0 30px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.ir-thank-you-signature {
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    font-style: italic;
    color: #6c757d;
    margin: 0 0 30px;
}

.ir-thank-you-close {
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    padding: 12px 40px;
    background: #0666E6;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ir-thank-you-close:hover {
    background: #0555c5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6, 102, 230, 0.3);
}

/* Password Toggle */
.ir-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.ir-password-wrapper .ir-input {
    padding-right: 48px;
    width: 100%;
}

.ir-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.ir-password-toggle:hover {
    color: #0666E6;
}

.ir-password-toggle:focus {
    outline: none;
    color: #0666E6;
}

.ir-password-toggle svg {
    display: block;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ir-thank-you-content {
        padding: 40px 30px;
    }

    .ir-thank-you-logo img {
        max-width: 200px;
    }

    .ir-thank-you-title {
        font-size: 28px;
    }

    .ir-thank-you-message {
        font-size: 16px;
    }

    .ir-agent-hero {
        padding: 30px 20px 40px;
    }

    .ir-agent-icon-wrapper {
        width: 80px;
        height: 80px;
        margin-bottom: 24px;
    }

    .ir-agent-icon {
        width: 44px;
        height: 44px;
    }

    .ir-become-agent-title {
        font-size: 24px;
    }

    .ir-become-agent-subtitle {
        font-size: 14px;
    }
}

/* ============================================
   ROLE SELECTION POPUP
   ============================================ */

/* Ensure wrapper has min-height when modal is showing */
.ir-registration-wrapper {
    min-height: 100vh;
    position: relative;
}

/* When modal is open, ensure background page doesn't collapse */
.ir-registration-wrapper:has(.ir-role-selection-modal) {
    min-height: 100vh;
}

.ir-role-selection-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ir-role-selection-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.ir-role-selection-container {
    position: relative;
    z-index: 100000;
    width: 90%;
    max-width: 900px;
}

.ir-role-selection-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 50px 40px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: roleSelectionSlideIn 0.3s ease-out;
}

@keyframes roleSelectionSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ir-role-selection-title {
    font-family: inherit;
    font-size: 32px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px;
    letter-spacing: -0.5px;
}

.ir-role-selection-subtitle {
    font-family: inherit;
    font-size: 16px;
    color: #64748b;
    margin: 0 0 40px;
}

.ir-role-selection-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.ir-role-selection-footer p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

.ir-role-selection-footer a {
    color: #0666E6;
    text-decoration: none;
    font-weight: 500;
}

.ir-role-selection-footer a:hover {
    text-decoration: underline;
}

.ir-role-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.ir-role-option {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 40px 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.ir-role-option:hover {
    border-color: #0666E6;
    background: #f0f7ff;
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(6, 102, 230, 0.15);
}

.ir-role-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e7f1ff 0%, #f0f7ff 100%);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.ir-role-option:hover .ir-role-icon {
    background: linear-gradient(135deg, #d0e5ff 0%, #e7f1ff 100%);
    transform: scale(1.05);
}

.ir-role-icon img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(28%) sepia(93%) saturate(2463%) hue-rotate(209deg) brightness(96%) contrast(96%);
}

.ir-role-title {
    font-family: inherit;
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.ir-role-description {
    font-family: inherit;
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

.ir-role-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Role Hero Sections */
.ir-role-hero {
    text-align: center;
    padding: 40px 20px 50px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.ir-role-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #e7f1ff 0%, #f0f7ff 100%);
    border-radius: 50%;
    margin: 0 auto 30px;
    box-shadow: 0 4px 16px rgba(6, 102, 230, 0.08);
    transition: all 0.3s ease;
}

.ir-role-icon-wrapper:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(6, 102, 230, 0.15);
}

.ir-role-icon-wrapper img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(28%) sepia(93%) saturate(2463%) hue-rotate(209deg) brightness(96%) contrast(96%);
}

.ir-role-hero-title {
    font-family: inherit;
    font-size: 28px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px;
    letter-spacing: -0.5px;
}

.ir-role-hero-subtitle {
    font-family: inherit;
    font-size: 15px;
    font-weight: 400;
    color: #64748b;
    margin: 0;
    line-height: 1.6;
}

/* Change Role Button */
.ir-change-role-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.ir-change-role-btn:hover {
    background: #f8fafc;
    border-color: #0666E6;
    color: #0666E6;
    text-decoration: none;
}

.ir-change-role-btn svg {
    width: 16px;
    height: 16px;
}

/* Role-specific field sections */
.ir-buyer-fields,
.ir-seller-fields,
.ir-agent-fields {
    display: none;
}

/* Mobile Responsive for Role Selection */
@media (max-width: 768px) {
    .ir-role-selection-content {
        padding: 30px 20px;
    }

    .ir-role-selection-title {
        font-size: 24px;
        margin-bottom: 30px;
    }

    .ir-role-options {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .ir-role-option {
        padding: 24px 20px;
        flex-direction: row;
        text-align: left;
        gap: 16px;
    }

    .ir-role-icon {
        width: 60px;
        height: 60px;
        flex-shrink: 0;
    }

    .ir-role-icon img {
        width: 32px;
        height: 32px;
    }

    .ir-role-text {
        flex: 1;
    }

    .ir-role-title {
        font-size: 18px;
    }

    .ir-role-description {
        font-size: 13px;
    }

    .ir-role-hero {
        padding: 30px 20px 40px;
    }

    .ir-role-icon-wrapper {
        width: 80px;
        height: 80px;
        margin-bottom: 24px;
    }

    .ir-role-icon-wrapper img {
        width: 44px;
        height: 44px;
    }

    .ir-role-hero-title {
        font-size: 24px;
    }

    .ir-role-hero-subtitle {
        font-size: 14px;
    }
}
