/**
 * WPCrypto Registration Form - Minimal & Responsive
 * WordPress theme compatible design
 */

/* Base Container - Single layer structure */
.wpcrypto-register-form {
    width: 99%;
    max-width: 420px;
    margin: 20px auto;
    padding: 0 3px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    box-sizing: border-box;
}

.wpcrypto-register-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 12px 12px 0 0;
}

/* Header Section */
.register-header {
    text-align: center;
    padding: 24px 16px 20px;
}

.register-header .brand-logo img {
    max-height: 48px;
    width: auto;
    margin-bottom: 16px;
}

.register-header .brand-text {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 16px 0;
    line-height: 1.2;
}

.register-header .main-title {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.register-header .subtitle {
    font-size: 16px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

/* Messages */
.register-messages {
    margin: 0 16px 20px;
}

.message-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid;
    margin-bottom: 12px;
    animation: slideIn 0.3s ease-out;
}

.error-container {
    background: #fef2f2;
    border-color: #ef4444;
    color: #dc2626;
}

.success-container {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #16a34a;
}

.message-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

.message-text {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    margin: 0;
}

/* Form Fields */
.register-fields {
    padding: 0 16px;
}

.field-group {
    margin-bottom: 24px;
}

.field-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.label-required {
    color: #ef4444;
}

.label-optional {
    color: #9ca3af;
    font-size: 12px;
    font-weight: 400;
}

/* Input Styling */
.input-wrapper {
    position: relative;
    width: 100%;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    z-index: 2;
    pointer-events: none;
}

.form-input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    font-size: 16px;
    color: #1f2937;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
    margin: 0;
}

.form-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input:hover:not(:focus) {
    border-color: #d1d5db;
}

.form-input::placeholder {
    color: #9ca3af;
}

.form-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: #6b7280;
}

.password-toggle:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Password Strength */
.password-strength {
    margin-top: 8px;
}

.strength-bar {
    height: 4px;
    background: #f3f4f6;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.strength-fill {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-fill.weak {
    width: 25%;
    background: #ef4444;
}

.strength-fill.fair {
    width: 50%;
    background: #f59e0b;
}

.strength-fill.good {
    width: 75%;
    background: #3b82f6;
}

.strength-fill.strong {
    width: 100%;
    background: #22c55e;
}

.strength-text {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
}

.strength-text.weak { color: #ef4444; }
.strength-text.fair { color: #f59e0b; }
.strength-text.good { color: #3b82f6; }
.strength-text.strong { color: #22c55e; }

/* Password Requirements */
.password-requirements {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.requirement {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #9ca3af;
}

.requirement.met {
    color: #22c55e;
}

.req-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.requirement:not(.met) .req-icon {
    opacity: 0.3;
}

.field-hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
    line-height: 1.4;
}

.error-message {
    font-size: 12px;
    color: #ef4444;
    margin-top: 6px;
}

/* Captcha Section */
.captcha-section {
    margin: 24px 16px;
}

.captcha-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.slider-captcha {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
}

.slider-track {
    position: relative;
    height: 48px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 24px;
    overflow: hidden;
    cursor: pointer;
}

.slider-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #22c55e, #3b82f6);
    transition: width 0.3s ease;
    border-radius: 24px;
}

.slider-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    user-select: none;
    pointer-events: none;
    z-index: 1;
}

.slider-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 42px;
    height: 42px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
    z-index: 2;
}

.slider-thumb:hover {
    transform: scale(1.05);
}

.slider-thumb:active {
    cursor: grabbing;
}

.slider-icon {
    color: #9ca3af;
    width: 20px;
    height: 20px;
}

.slider-captcha.verified .slider-text {
    color: #ffffff;
}

.slider-captcha.verified .slider-thumb {
    background: #22c55e;
}

.slider-captcha.verified .slider-icon {
    color: #ffffff;
}

/* Terms Section */
.terms-section {
    margin: 24px 16px;
}

.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.custom-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
    user-select: none;
}

.checkbox-box {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-icon {
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
    color: #ffffff;
    width: 12px;
    height: 12px;
}

.custom-checkbox:checked + .checkbox-label .checkbox-box {
    background: #667eea;
    border-color: #667eea;
}

.custom-checkbox:checked + .checkbox-label .checkbox-box .checkbox-icon {
    opacity: 1;
    transform: scale(1);
}

.custom-checkbox:focus + .checkbox-label .checkbox-box {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.checkbox-text {
    color: #4b5563;
}

.terms-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.terms-link:hover {
    color: #5a6fd8;
    text-decoration: underline;
}

/* Submit Section */
.submit-section {
    margin: 24px 16px;
}

.submit-btn {
    width: 100%;
    min-height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.submit-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
}

.btn-icon {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

.submit-btn:hover:not(:disabled) .btn-icon {
    transform: translateX(2px);
}

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

/* Footer */
.register-footer {
    padding: 20px 16px 24px;
    border-top: 1px solid #f3f4f6;
    text-align: center;
}

.login-link {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 20px;
}

.link-primary {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.link-primary:hover {
    color: #5a6fd8;
    text-decoration: underline;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.feature-item:hover {
    background: #f3f4f6;
}

.feature-icon {
    width: 32px;
    height: 32px;
    color: #667eea;
    background: #ffffff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.feature-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 2px 0;
}

.feature-content p {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
}

/* Logged In State */
.wpcrypto-logged-in-wrapper {
    width: 99%;
    max-width: 420px;
    margin: 40px auto;
    padding: 0 3px;
    box-sizing: border-box;
}

.wpcrypto-logged-in-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 32px 24px;
    text-align: center;
}

.logged-in-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    color: #22c55e;
    background: #f0fdf4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpcrypto-logged-in-container h2 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 12px 0;
}

.wpcrypto-logged-in-container p {
    font-size: 16px;
    color: #64748b;
    margin: 0 0 24px 0;
    line-height: 1.5;
}

.dashboard-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.dashboard-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (min-width: 480px) {
    .wpcrypto-register-form {
        width: 95%;
        padding: 0 8px;
    }
    
    .register-header {
        padding: 32px 24px 24px;
    }
    
    .register-fields {
        padding: 0 24px;
    }
    
    .captcha-section,
    .terms-section,
    .submit-section {
        margin-left: 24px;
        margin-right: 24px;
    }
    
    .register-footer {
        padding: 24px 24px 32px;
    }
    
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    
    .feature-item {
        flex-direction: column;
        text-align: center;
        padding: 16px;
    }
    
    .password-requirements {
        flex-direction: row;
        gap: 16px;
    }
}

@media (min-width: 768px) {
    .wpcrypto-register-form {
        width: 90%;
        max-width: 480px;
        padding: 0 12px;
    }
    
    .register-header .main-title {
        font-size: 32px;
    }
    
    .register-header .subtitle {
        font-size: 18px;
    }
}

@media (min-width: 1024px) {
    .wpcrypto-register-form {
        width: 85%;
        max-width: 520px;
        padding: 0 16px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .wpcrypto-register-form {
        background: #1e293b;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    }
    
    .register-header .brand-text,
    .register-header .main-title {
        color: #f8fafc;
    }
    
    .register-header .subtitle {
        color: #cbd5e1;
    }
    
    .field-label {
        color: #e2e8f0;
    }
    
    .form-input {
        background: #334155;
        border-color: #475569;
        color: #f1f5f9;
    }
    
    .form-input:focus {
        border-color: #667eea;
        background: #334155;
    }
    
    .form-input::placeholder {
        color: #94a3b8;
    }
    
    .slider-captcha {
        background: #334155;
        border-color: #475569;
    }
    
    .slider-track {
        background: #475569;
        border-color: #64748b;
    }
    
    .checkbox-box {
        background: #334155;
        border-color: #64748b;
    }
    
    .checkbox-text {
        color: #cbd5e1;
    }
    
    .feature-item {
        background: #334155;
    }
    
    .feature-item:hover {
        background: #475569;
    }
    
    .feature-content h4 {
        color: #f1f5f9;
    }
    
    .feature-content p {
        color: #94a3b8;
    }
    
    .register-footer {
        border-top-color: #475569;
    }
    
    .login-link {
        color: #94a3b8;
    }
    
    .wpcrypto-logged-in-container {
        background: #1e293b;
    }
    
    .wpcrypto-logged-in-container h2 {
        color: #f8fafc;
    }
    
    .wpcrypto-logged-in-container p {
        color: #cbd5e1;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .form-input,
    .submit-btn {
        min-height: 44px;
    }
    
    .checkbox-box {
        width: 24px;
        height: 24px;
    }
    
    .slider-thumb {
        width: 40px;
        height: 40px;
    }
    
    .submit-btn:hover {
        transform: none;
    }
    
    .feature-item:hover {
        background: #f9fafb;
    }
    
    .dashboard-btn:hover {
        transform: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .form-input {
        border-width: 3px;
    }
    
    .submit-btn {
        border: 2px solid transparent;
    }
    
    .checkbox-box {
        border-width: 3px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms;
        animation-iteration-count: 1;
        transition-duration: 0.01ms;
    }
}