/**
 * Gerrards Utilities - Custom Authentication Styles
 *
 * @package Gerrards_Utilities
 */

/* Container */
.gerrards-auth-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Desktop Layout Container */
.login-layout-desktop {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Login Form Section */
.login-form-section {
    flex: 1;
}

/* Benefits Section */
.benefits-section {
    flex: 1;
}

.gerrards-auth-container * {
    box-sizing: border-box;
}

/* Title */
.auth-title {
    font-size: 2.5rem;
    font-weight: 400;
    text-align: center;
    margin-bottom: 1.5rem;
    color: #333;
}

/* Forms */
.auth-form {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1rem;
}

/* Registration Steps */
.registration-steps {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2.5rem;
    padding: 0 1rem;
}

.step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #999;
    font-size: 0.9rem;
}

.step.active {
    color: #16284f;
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 0.85rem;
}

.step.active .step-number {
    background: #16284f;
    color: white;
}

/* Form Steps */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group.half {
    flex: 0 0 calc(50% - 0.5rem);
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Labels */
.form-group label {
    display: block;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #333;
}

.required {
    color: #dc3545;
}

/* Password Toggle */
.password-toggle {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    margin-top: 0.5rem;
}

.form-group .password-toggle {
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
}

.password-toggle:hover {
    color: #374151;
}

/* Input Fields */
.input-wrapper {
    position: relative;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"] {
    width: 100%;
    padding: 1rem 1.25rem !important;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    line-height: 1.2;
    vertical-align: middle;
    height: 56px;
    min-height: 56px;
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder,
input[type="tel"]::placeholder {
    color: #9ca3af;
    font-size: 1rem;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus {
    outline: none;
    border-color: #16284f;
    box-shadow: 0 0 0 3px rgba(22, 40, 79, 0.1);
}

/* Custom Select Styling */
select {
    width: 100%;
    padding: 1rem !important;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path fill="%23374151" d="M4.427 6.573a.75.75 0 111.146-.954L8 8.586l2.427-2.967a.75.75 0 111.146.954l-3 3.667a.75.75 0 01-1.146 0l-3-3.667z"/></svg>');
    background-repeat: no-repeat;
    background-position: calc(100% - 1rem) center;
    background-size: 16px;
    padding-right: 3rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    line-height: 1.2;
    height: 56px;
    min-height: 56px;
}

select:focus {
    outline: none;
    border-color: #16284f;
    box-shadow: 0 0 0 3px rgba(22, 40, 79, 0.1);
}

select::-ms-expand {
    display: none;
}

input.error {
    border-color: #dc3545;
}

input.valid {
    border-color: #10b981;
}

.input-wrapper.valid select {
    border-color: #10b981;
}

.input-wrapper.error select {
    border-color: #dc3545;
}

/* Validation Icons */
.validation-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-wrapper.valid .validation-icon::before {
    content: "●●●";
    color: #10b981;
    font-size: 8px;
    line-height: 1;
}

.input-wrapper.error .validation-icon::before {
    content: "!";
    color: #dc3545;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fef2f2;
    border: 1px solid #fecaca;
    font-size: 12px;
}

/* Field Messages */
.field-message {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    min-height: 1.2rem;
}

/* Password Requirements */
.password-requirements {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.password-requirements .requirements-hint {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 0.5rem 0;
    text-align: center;
}

.password-requirements ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.password-requirements li {
    font-size: 0.8rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.2s ease;
}

.password-requirements li::before {
    content: "○";
    font-size: 0.65rem;
    color: #9ca3af;
    transition: all 0.2s ease;
}

.password-requirements li.met {
    color: #059669;
}

.password-requirements li.met::before {
    content: "✓";
    color: #059669;
    font-weight: bold;
    font-size: 0.8rem;
}

.password-requirements li.not-met {
    color: #dc2626;
}

.password-requirements li.not-met::before {
    content: "✕";
    color: #dc2626;
    font-weight: bold;
    font-size: 0.75rem;
}

/* Password Strength Meter */
.password-strength-meter {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.password-strength-meter .strength-bar {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.password-strength-meter .strength-bar::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    border-radius: 3px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.password-strength-meter .strength-bar.weak::after {
    width: 25%;
    background: #dc2626;
}

.password-strength-meter .strength-bar.fair::after {
    width: 50%;
    background: #f59e0b;
}

.password-strength-meter .strength-bar.good::after {
    width: 75%;
    background: #84cc16;
}

.password-strength-meter .strength-bar.strong::after {
    width: 100%;
    background: #059669;
}

.password-strength-meter .strength-text {
    font-size: 0.75rem;
    font-weight: 500;
    min-width: 60px;
    text-align: right;
    color: #6b7280;
}

.password-strength-meter .strength-bar.weak + .strength-text {
    color: #dc2626;
}

.password-strength-meter .strength-bar.fair + .strength-text {
    color: #f59e0b;
}

.password-strength-meter .strength-bar.good + .strength-text {
    color: #84cc16;
}

.password-strength-meter .strength-bar.strong + .strength-text {
    color: #059669;
}

/* Radio Groups */
.radio-group {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    justify-content: center;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal !important;
    margin-bottom: 0 !important;
}

.radio-option input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    margin-bottom: 0;
    accent-color: #16284f;
}

.radio-label {
    font-size: 1rem;
    color: #374151;
}

/* Buttons */
.auth-button {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    line-height: 1.2;
}

.auth-button.primary {
    background: #16284f;
    color: white;
    border-color: #16284f;
}

.auth-button.primary:hover {
    background: #0d1a35;
    border-color: #0d1a35;
    color: white;
}

.auth-button.secondary {
    background: transparent;
    color: #374151;
    border-color: #d1d5db;
}

.auth-button.secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #374151;
}

/* Form Navigation */
.form-navigation {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.form-navigation .auth-button {
    flex: 1;
}

/* Form Actions */
.form-actions {
    margin-bottom: 1.2rem;
}

.reset-password-link,
.back-to-login {
    color: #374151;
    text-decoration: underline;
    font-size: 0.9rem;
}

.reset-password-link:hover,
.back-to-login:hover {
    color: #111827;
}

/* Auth Switch */
.auth-switch {
    text-align: center;
    margin-top: 10px;
}

.auth-switch p {
    margin-bottom: 1rem;
    color: #6b7280;
    font-size: 1.1rem;
}

.account-benefits {
    margin-top: 1.5rem;
    text-align: left;
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.account-benefits p {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    color: #374151;
}

.account-benefits ul {
    margin: 0;
    padding-left: 1.5rem;
    list-style: none;
}

.account-benefits li {
    margin-bottom: 0.5rem;
    color: #6b7280;
    font-size: 0.9rem;
    position: relative;
    padding-left: 1.5rem;
}

.account-benefits li::before {
    content: "✓";
    color: #10b981;
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 0;
}

/* Form Messages */
.form-messages {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    display: none;
}

.form-messages.success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
    display: block;
}

.form-messages.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    display: block;
}

/* Loading States */
.auth-button:disabled,
.auth-button.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-button.loading::after {
    content: "...";
    animation: loading 1s infinite;
}

@keyframes loading {
    0%, 33% { content: ""; }
    34%, 66% { content: "."; }
    67%, 99% { content: ".."; }
    100% { content: "..."; }
}

/* Company Field Animation */
.company-field {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.company-field.show {
    opacity: 1;
    max-height: 100px;
    display: block !important;
}

/* Sell Metals Field Animation */
.sell-metals-field {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sell-metals-field.show {
    opacity: 1;
    max-height: 200px;
    display: block !important;
}

/* Checkbox Groups */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #c9a227;
    cursor: pointer;
}

/* Desktop Layout */
@media (min-width: 1024px) {
    .gerrards-auth-container {
        max-width: 1100px;
        padding: 1.5rem;
    }
    
    .login-layout-desktop {
        flex-direction: row;
        align-items: stretch;
        justify-content: center;
        gap: 4rem;
    }
    
    .login-form-section {
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    
    .login-form-section .gerrards-login-form {
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    
    .login-form-section .auth-form {
        background: white;
        border-radius: 12px;
        padding: 1.8rem;
        margin-bottom: 0;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        border: 1px solid #e5e7eb;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .benefits-section {
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    
    .unified-right-content {
        background: white;
        border-radius: 12px;
        border: 1px solid #e5e7eb;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        padding: 1.2rem 1.8rem 1.8rem 1.8rem;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .unified-right-content .auth-switch {
        text-align: center;
        margin-bottom: 0.5rem;
    }

    .unified-right-content .auth-switch p {
        margin-bottom: 0.75rem;
        color: #6b7280;
        font-size: 1.1rem;
    }
    
    .unified-right-content .account-benefits {
        flex: none;
    }
    
    .unified-right-content .account-benefits p {
        margin-bottom: 0.8rem;
        font-size: 1.1rem;
        color: #374151;
        text-align: left;
    }
    
    .unified-right-content .account-benefits ul {
        margin: 0;
        padding-left: 0;
        list-style: none;
    }
    
    .unified-right-content .account-benefits li {
        margin-bottom: 0.7rem;
        color: #6b7280;
        font-size: 1rem;
        position: relative;
        padding-left: 2rem;
        line-height: 1.4;
    }
    
    .unified-right-content .account-benefits li:last-child {
        margin-bottom: 0;
    }
    
    .unified-right-content .account-benefits li::before {
        content: "✓";
        color: #10b981;
        font-weight: bold;
        position: absolute;
        left: 0;
        top: 0;
        font-size: 1.1rem;
    }
}

/* Medium screens - single column with better spacing */
@media (min-width: 768px) and (max-width: 1023px) {
    .gerrards-auth-container {
        max-width: 600px;
        padding: 2rem 1rem;
    }
    
    .login-layout-desktop {
        flex-direction: column;
        gap: 2rem;
        min-height: auto;
    }
    
    .login-form-section,
    .benefits-section {
        flex: none;
    }
    
    .login-form-section .gerrards-login-form {
        justify-content: flex-start;
    }
    
    .login-form-section .auth-form {
        background: white;
        border-radius: 12px;
        padding: 2rem;
        margin-bottom: 0;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        border: 1px solid #e5e7eb;
    }
    
    .unified-right-content {
        background: white;
        border-radius: 12px;
        border: 1px solid #e5e7eb;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        padding: 1.2rem 2rem 2rem 2rem;
    }
    
    .unified-right-content .auth-switch {
        text-align: center;
        margin-bottom: 1rem;
    }
}

/* Mobile Layout */
@media (max-width: 767px) {
    .login-layout-desktop {
        flex-direction: column;
        gap: 2rem;
        min-height: auto;
    }
    
    .login-form-section,
    .benefits-section {
        flex: none;
    }
    
    .login-form-section .gerrards-login-form {
        justify-content: flex-start;
    }
    
    .unified-right-content {
        background: white;
        border-radius: 8px;
        border: 1px solid #e5e7eb;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        padding: 1rem 1.5rem 1.5rem 1.5rem;
    }
    
    .unified-right-content .auth-switch {
        text-align: center;
        margin-bottom: 1rem;
    }
}

@media (max-width: 640px) {
    .gerrards-auth-container {
        padding: 1rem;
    }

    .auth-form {
        padding: 1.5rem;
    }

    .auth-title {
        font-size: 2rem;
    }

    .registration-steps {
        gap: 1rem;
        flex-wrap: wrap;
    }

    .step {
        font-size: 0.8rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-group.half {
        flex: none;
        width: 100%;
    }

    .form-navigation {
        flex-direction: column;
    }

    .password-toggle {
        position: static;
        float: none;
        display: block;
        margin-top: 0.25rem;
    }

    .password-requirements ul {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .radio-group {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* Print Styles */
@media print {
    .gerrards-auth-container {
        display: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    select {
        border-width: 3px;
    }
    
    .auth-button {
        border-width: 3px;
    }
}

/* Reduce Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}