/* ==========================================================================
   Tecshelf Authentication & Signup - Clean & Natural UI/UX
   Consistent with Platform Design System & Color Palette
   ========================================================================== */

.auth-page {
    min-height: 100vh;
    display: flex;
    background-color: var(--gray-50, #F9FAFB);
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--gray-900, #111827);
}

/* ==========================================================================
   Left Sidebar: Authentic Brand Theme (Primary Deep Blue)
   ========================================================================== */
.auth-sidebar {
    flex: 0 0 460px;
    background-color: var(--primary-600, #2563EB);
    color: #ffffff;
    padding: 3.5rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow-y: auto;
    position: relative;
}

.auth-sidebar-inner {
    max-width: 380px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100%;
    gap: 2.25rem;
}

.auth-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.auth-sidebar-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.auth-sidebar-logo-img {
    height: 38px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    display: block;
}

.auth-sidebar-brand-text {
    font-size: 1.6rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    font-family: 'Nunito', 'DM Sans', sans-serif;
}

.auth-brand-badge {
    font-size: 0.725rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.35rem 0.65rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.22);
    white-space: nowrap;
}

.auth-sidebar-hero h1 {
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.025em;
    color: #ffffff;
    margin-bottom: 0.85rem;
    font-family: 'Nunito', 'DM Sans', sans-serif;
}

.auth-sidebar-hero p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

/* Feature Benefits List (Natural SVG Icons) */
.auth-benefits-list,
.auth-features {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 0.95rem;
}

.auth-benefit-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #ffffff;
    margin-top: 1px;
}

.auth-benefit-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.auth-benefit-text strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
}

.auth-benefit-text span {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.45;
}

.auth-benefit-text code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.825rem;
    background: rgba(0, 0, 0, 0.22);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    color: #ffffff;
}

/* Backwards compatibility for login.ejs */
.auth-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: #ffffff;
    line-height: 1.45;
}

.auth-feature svg {
    width: 20px;
    height: 20px;
    color: var(--accent-400, #34D399);
    flex-shrink: 0;
}

.auth-sidebar-footer {
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.auth-security-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.85);
}

.auth-security-badge svg {
    color: var(--accent-300, #6EE7B7);
    flex-shrink: 0;
}

.auth-copyright {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* ==========================================================================
   Right Form Container: Natural, High-Usability UI/UX
   ========================================================================== */
.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background-color: var(--gray-50, #F9FAFB);
    min-height: 100vh;
}

.auth-form-container {
    width: 100%;
    max-width: 530px;
    margin: 0 auto;
}

.auth-card {
    background-color: #ffffff;
    border: 1px solid var(--gray-200, #E5E7EB);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 20px 25px -5px rgba(0, 0, 0, 0.05);
}

.auth-card-header {
    margin-bottom: 1.75rem;
    text-align: left;
}

.auth-card-header h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gray-900, #111827);
    letter-spacing: -0.025em;
    margin-bottom: 0.35rem;
    font-family: 'Nunito', 'DM Sans', sans-serif;
}

.auth-card-header p {
    font-size: 0.95rem;
    color: var(--gray-600, #4B5563);
    margin: 0;
}

/* Form Layout */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    margin: 0;
}

.form-label {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700, #374151);
    margin-bottom: 0.45rem;
}

.required-asterisk {
    color: var(--error-500, #EF4444);
    margin-left: 0.2rem;
}

.form-input {
    width: 100%;
    height: 44px;
    padding: 0 0.875rem;
    background-color: #ffffff;
    border: 1.5px solid var(--gray-300, #D1D5DB);
    border-radius: 8px;
    font-size: 0.925rem;
    color: var(--gray-900, #111827);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
    font-family: inherit;
}

.form-input:focus {
    border-color: var(--primary-600, #2563EB);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.form-input::placeholder {
    color: var(--gray-500, #6B7280);
}

/* Natural Username Input with tecshelf/ Prefix */
.username-input-wrap {
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border: 1.5px solid var(--gray-300, #D1D5DB);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.username-input-wrap:focus-within {
    border-color: var(--primary-600, #2563EB);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.username-prefix {
    background-color: var(--gray-100, #F3F4F6);
    color: var(--gray-600, #4B5563);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0 0.85rem;
    display: flex;
    align-items: center;
    border-right: 1.5px solid var(--gray-300, #D1D5DB);
    user-select: none;
}

.username-input-field {
    flex: 1;
    height: 44px;
    border: none;
    background: transparent;
    padding: 0 2.5rem 0 0.85rem;
    font-size: 0.925rem;
    color: var(--gray-900, #111827);
    outline: none;
    font-family: inherit;
    min-width: 0;
}

.username-status-spinner {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid var(--gray-200, #E5E7EB);
    border-top-color: var(--primary-600, #2563EB);
    border-radius: 50%;
    animation: authSpin 0.7s linear infinite;
    display: none;
    pointer-events: none;
}

.username-status-icon {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

@keyframes authSpin {
    to { transform: translateY(-50%) rotate(360deg); }
}

.username-input-wrap.is-valid,
.username-input-wrap:has(.is-valid) {
    border-color: var(--success-600, #16A34A) !important;
}

.username-input-wrap.is-invalid,
.username-input-wrap:has(.is-invalid) {
    border-color: var(--error-500, #EF4444) !important;
}

.username-feedback {
    font-size: 0.8rem;
    margin-top: 0.35rem;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.username-feedback.is-valid { color: var(--success-600, #16A34A); font-weight: 600; }
.username-feedback.is-invalid { color: var(--error-500, #EF4444); font-weight: 600; }
.username-feedback.is-checking { color: var(--gray-500, #6B7280); }

.username-store-url-preview {
    font-size: 0.825rem;
    color: var(--gray-600, #4B5563);
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.username-store-url-preview strong {
    color: var(--primary-700, #1D4ED8);
    background: var(--primary-50, #EFF6FF);
    border: 1px solid var(--primary-100, #DBEAFE);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.825rem;
}

/* Country Selector Input & Custom Dropdown */
.country-select-group {
    position: relative;
}

.country-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.country-input-wrap .form-input {
    padding-right: 2.25rem;
}

.country-caret-icon {
    position: absolute;
    right: 0.85rem;
    pointer-events: none;
    color: var(--gray-500, #6B7280);
}

#countryDropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    background: #ffffff;
    border: 1.5px solid var(--gray-300, #D1D5DB);
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    list-style: none;
    margin: 0;
    padding: 0.35rem 0;
    z-index: 1000;
}

#countryDropdown li {
    padding: 0.55rem 1rem;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--gray-800, #1F2937);
    transition: background-color 0.15s ease;
}

#countryDropdown li:hover {
    background-color: var(--primary-50, #EFF6FF);
    color: var(--primary-700, #1D4ED8);
}

/* Password Group & Eye Button */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .form-input {
    padding-right: 2.75rem;
}

.password-toggle-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--gray-500, #6B7280);
    padding: 0.4rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.password-toggle-btn:hover {
    color: var(--gray-800, #1F2937);
    background-color: var(--gray-100, #F3F4F6);
}

.password-strength-container {
    margin-top: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.password-strength-track {
    flex: 1;
    height: 5px;
    background-color: var(--gray-200, #E5E7EB);
    border-radius: 9999px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0%;
    background-color: var(--error-500, #EF4444);
    transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500, #6B7280);
    min-width: 70px;
    text-align: right;
}

/* Form Hints */
.form-hint {
    font-size: 0.785rem;
    color: var(--gray-500, #6B7280);
    margin-top: 0.35rem;
    line-height: 1.4;
}

/* Seller Account Card Option */
.auth-seller-toggle-card {
    background-color: var(--gray-50, #F9FAFB);
    border: 1.5px solid var(--gray-200, #E5E7EB);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.auth-seller-toggle-card:hover {
    border-color: var(--primary-300, #93C5FD);
    background-color: #ffffff;
}

/* Checkboxes */
.auth-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
    width: 100%;
}

.auth-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-600, #2563EB);
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.auth-checkbox-content {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.checkbox-title {
    font-size: 0.885rem;
    font-weight: 600;
    color: var(--gray-800, #1F2937);
    line-height: 1.35;
}

.checkbox-desc {
    font-size: 0.785rem;
    color: var(--gray-500, #6B7280);
    line-height: 1.4;
}

.auth-checkbox a {
    color: var(--primary-600, #2563EB);
    text-decoration: none;
    font-weight: 600;
}

.auth-checkbox a:hover {
    text-decoration: underline;
}

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    height: 48px;
    background-color: var(--primary-600, #2563EB);
    border: 1px solid var(--primary-600, #2563EB);
    border-radius: 8px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.15s ease;
    margin-top: 0.5rem;
    letter-spacing: -0.01em;
}

.auth-submit-btn:hover:not(:disabled) {
    background-color: var(--primary-700, #1D4ED8);
    border-color: var(--primary-700, #1D4ED8);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
    transform: translateY(-1px);
}

.auth-submit-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Footer Link */
.auth-footer {
    text-align: center;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--gray-200, #E5E7EB);
    font-size: 0.9rem;
    color: var(--gray-600, #4B5563);
}

.auth-footer a {
    color: var(--primary-600, #2563EB);
    font-weight: 600;
    text-decoration: none;
    margin-left: 0.25rem;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1024px) {
    .auth-sidebar {
        flex: 0 0 380px;
        padding: 2.75rem 2rem;
    }

    .auth-card {
        padding: 2rem 1.75rem;
    }
}

@media (max-width: 900px) {
    .auth-page {
        flex-direction: column;
    }

    .auth-sidebar {
        flex: none;
        padding: 2.5rem 1.75rem;
        min-height: auto;
    }

    .auth-sidebar-inner {
        max-width: 530px;
        gap: 1.75rem;
    }

    .auth-benefits-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .auth-sidebar-footer {
        display: none;
    }

    .auth-main {
        padding: 2rem 1rem;
        min-height: auto;
    }
}

@media (max-width: 600px) {
    .form-row-2col {
        grid-template-columns: 1fr;
    }

    .auth-benefits-list {
        grid-template-columns: 1fr;
    }

    .auth-sidebar {
        padding: 2rem 1.25rem;
    }

    .auth-main {
        padding: 1.5rem 0.85rem;
    }

    .auth-card {
        padding: 1.75rem 1.25rem;
        border-radius: 12px;
    }

    .auth-card-header h2 {
        font-size: 1.5rem;
    }
}
