/**
 * WooBedding Registration Form Styles
 * File: assets/css/woobedding-register.css
 */

/* Variabili colori principali (coerenti con il resto del plugin) */
:root {
    --woobedding-primary: #00448A;
    --woobedding-secondary: #003366;
    --woobedding-primary-light: #0056b3;
    --woobedding-primary-dark: #002952;
    --woobedding-dark: #333;
    --woobedding-light: #f8f8f8;
    --woobedding-border: #ddd;
    --woobedding-success: #10b981;
    --woobedding-error: #ef4444;
    --woobedding-info: #2196f3;
    --woobedding-warning: #f59e0b;
    --woobedding-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --woobedding-shadow-lg: 0 4px 20px rgba(0,0,0,0.15);
    --woobedding-transition: all 0.3s ease;
}

/* Container principale */
.woobedding-register-container {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--woobedding-dark);
    max-width: 1200px;
    margin: 50px auto;
    padding: 20px;
}

/* Layout a due colonne */
.register-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--woobedding-shadow-lg);
    overflow: hidden;
}

/* Form Wrapper */
.register-form-wrapper {
    padding: 50px;
}

.register-form-wrapper h2 {
    color: var(--woobedding-primary);
    margin: 0 0 10px 0;
    font-size: 32px;
    font-weight: 700;
}

.register-subtitle {
    color: #666;
    margin: 0 0 35px 0;
    font-size: 16px;
    line-height: 1.6;
}

/* Form Styles */
.woobedding-register-form .form-row {
    margin-bottom: 20px;
}

.woobedding-register-form .form-row.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--woobedding-dark);
    font-weight: 500;
    font-size: 14px;
}

.form-group label abbr.required {
    color: var(--woobedding-error);
    text-decoration: none;
    font-weight: 700;
}

.form-group .input-text {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--woobedding-border);
    border-radius: 10px;
    font-size: 16px;
    transition: var(--woobedding-transition);
    background: #fff;
    box-sizing: border-box;
}

.form-group .input-text:focus {
    outline: none;
    border-color: var(--woobedding-primary);
    box-shadow: 0 0 0 4px rgba(0, 68, 138, 0.1);
}

.form-group .input-text.error {
    border-color: var(--woobedding-error);
    background-color: #fef2f2;
}

.form-group .input-text.valid {
    border-color: var(--woobedding-success);
}

/* Password wrapper */
.password-wrapper {
    position: relative;
}

.password-wrapper .input-text {
    padding-right: 50px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #999;
    transition: var(--woobedding-transition);
}

.toggle-password:hover {
    color: var(--woobedding-primary);
}

/* Password strength meter */
.password-strength-meter {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.password-strength-meter .strength-bar {
    height: 100%;
    width: 0;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 2px;
}

.password-strength-meter.weak .strength-bar {
    width: 33%;
    background: var(--woobedding-error);
}

.password-strength-meter.medium .strength-bar {
    width: 66%;
    background: var(--woobedding-warning);
}

.password-strength-meter.strong .strength-bar {
    width: 100%;
    background: var(--woobedding-success);
}

.password-hint {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 6px;
}

/* Checkbox styling */
.checkbox-group {
    margin-top: 10px;
}

.woobedding-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.woobedding-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.woobedding-checkbox .checkmark {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
    height: 20px;
    width: 20px;
    min-width: 20px;
    background-color: #fff;
    border: 2px solid var(--woobedding-primary) !important;
    border-radius: 4px;
    transition: var(--woobedding-transition);
    margin-top: 2px;
    flex-shrink: 0;
}

.woobedding-checkbox:hover .checkmark {
    border-color: var(--woobedding-secondary);
}

.woobedding-checkbox input:checked ~ .checkmark {
    background-color: var(--woobedding-primary);
    border-color: var(--woobedding-primary);
}

.woobedding-checkbox .checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.woobedding-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-label {
    font-size: 14px;
    line-height: 1.5;
    color: #666;
}

.checkbox-label a {
    color: var(--woobedding-primary);
    text-decoration: none;
    font-weight: 500;
}

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

/* Form messages */
.form-messages {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-messages.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--woobedding-error);
}

.form-messages.success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: var(--woobedding-success);
}

.form-messages .message-content {
    flex: 1;
}

/* reCAPTCHA info */
.recaptcha-info {
    margin: 20px 0;
    padding: 12px 16px;
    background: var(--woobedding-light);
    border-radius: 8px;
}

.recaptcha-info small {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}

.recaptcha-info a {
    color: var(--woobedding-primary);
    text-decoration: none;
}

.recaptcha-info a:hover {
    text-decoration: underline;
}

/* Submit button */
.woobedding-register-btn {
    width: 100%;
    padding: 16px 32px;
    background: var(--woobedding-primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--woobedding-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 25px;
}

.woobedding-register-btn:hover:not(:disabled) {
    background: var(--woobedding-secondary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 68, 138, 0.4);
}

.woobedding-register-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.woobedding-register-btn .btn-loading {
    display: flex;
    align-items: center;
    gap: 10px;
}

.woobedding-register-btn .spinner {
    animation: spin 1s linear infinite;
}

.woobedding-register-btn .spinner-circle {
    stroke-dasharray: 60;
    stroke-dashoffset: 45;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Login link */
.login-link {
    text-align: center;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--woobedding-border);
}

.login-link p {
    margin: 0;
    color: #666;
    font-size: 15px;
}

.login-link a {
    color: var(--woobedding-primary);
    font-weight: 600;
    text-decoration: none;
    margin-left: 5px;
}

.login-link a:hover {
    text-decoration: underline;
}

/* Benefits column */
.register-benefits {
    background: var(--woobedding-primary);
    padding: 50px;
    display: flex;
    align-items: center;
}

.benefits-content {
    color: white;
}

.benefits-content h3 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 30px 0;
}

.benefits-list {
    list-style: none;
    padding: 0;
    margin: 0 0 40px 0;
}

.benefits-list li {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.benefits-list li:last-child {
    border-bottom: none;
}

.benefit-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.benefit-icon svg {
    stroke: white;
}

.benefit-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.benefit-text strong {
    font-size: 16px;
    font-weight: 600;
}

.benefit-text span {
    font-size: 14px;
    opacity: 0.85;
    line-height: 1.4;
}

/* Trust badges in register */
.trust-badges-register {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.trust-badges-register .trust-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    opacity: 0.9;
}

.trust-badges-register .trust-badge svg {
    stroke: white;
}

/* Already logged in state */
.already-logged-in {
    text-align: center;
    padding: 80px 40px;
    max-width: 500px;
    margin: 0 auto;
}

.logged-in-icon {
    margin-bottom: 30px;
}

.already-logged-in h2 {
    color: var(--woobedding-primary);
    margin: 0 0 15px 0;
    font-size: 28px;
    font-weight: 700;
}

.already-logged-in p {
    color: #666;
    margin: 0 0 30px 0;
    font-size: 16px;
}

.logged-in-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.woobedding-btn-primary,
.woobedding-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--woobedding-transition);
}

.woobedding-btn-primary {
    background: var(--woobedding-primary);
    color: #ffffff !important;
}

.woobedding-btn-primary:hover {
    background: var(--woobedding-secondary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 68, 138, 0.4);
    color: #ffffff !important;
}

.woobedding-btn-secondary {
    background: white;
    color: var(--woobedding-primary);
    border: 2px solid var(--woobedding-primary);
}

.woobedding-btn-secondary:hover {
    background: var(--woobedding-light);
    color: var(--woobedding-primary);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .register-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .register-form-wrapper {
        order: 1;
        padding: 40px;
    }

    .register-benefits {
        order: 2;
        padding: 40px;
    }
}

@media (max-width: 768px) {
    .woobedding-register-container {
        margin: 20px auto;
        padding: 15px;
    }

    .register-layout {
        border-radius: 12px;
    }

    .register-form-wrapper {
        padding: 30px 25px;
    }

    .register-form-wrapper h2 {
        font-size: 26px;
    }

    .woobedding-register-form .form-row.two-columns {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .register-benefits {
        padding: 30px 25px;
    }

    .benefits-content h3 {
        font-size: 22px;
    }

    .benefit-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }

    .benefit-icon svg {
        width: 20px;
        height: 20px;
    }

    .trust-badges-register {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .woobedding-register-container {
        margin: 10px auto;
        padding: 10px;
    }

    .register-form-wrapper {
        padding: 25px 20px;
    }

    .register-form-wrapper h2 {
        font-size: 22px;
    }

    .register-subtitle {
        font-size: 14px;
    }

    .form-group .input-text {
        padding: 12px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .woobedding-register-btn {
        padding: 14px 24px;
        font-size: 16px;
    }

    .logged-in-actions {
        flex-direction: column;
    }

    .woobedding-btn-primary,
    .woobedding-btn-secondary {
        width: 100%;
    }
}

/* Hide reCAPTCHA badge (we show our own notice) */
.grecaptcha-badge {
    visibility: hidden !important;
}
