/* ═══════════════════════════════════════════════════════════════════════════
   Register Page Styles
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Auth Page Layout (shared by register + login via class names) ────── */

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-secondary, #1a1a2e);
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
    border-radius: 16px;
    padding: 2.5rem 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary, #e0e0e0);
    margin: 0 0 0.5rem;
    line-height: 1.2;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary, #a0a0b0);
    margin: 0;
    line-height: 1.5;
}

/* ─── Error Display ──────────────────────────────────────────────────────── */

.auth-error {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    color: #ef4444;
    font-size: 0.875rem;
    line-height: 1.4;
}

.auth-error svg {
    flex-shrink: 0;
}

/* ─── Form ───────────────────────────────────────────────────────────────── */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
    user-select: none;
}

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

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-right: 2.75rem;
    background: var(--bg-tertiary, #0f0f1a);
    border: 1.5px solid var(--border-primary, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    color: var(--text-primary, #e0e0e0);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

.form-input::placeholder {
    color: var(--text-muted, #666680);
}

.form-input:focus {
    border-color: var(--accent-primary, #00bcd4);
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.15);
}

/* Validation states */
.form-group.is-valid .form-input {
    border-color: #22c55e;
}

.form-group.is-valid .form-input:focus {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.form-group.is-invalid .form-input {
    border-color: #ef4444;
}

.form-group.is-invalid .form-input:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* ─── Input Icons / Status Indicators ────────────────────────────────────── */

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

.input-icon-status::after {
    content: '';
    display: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.form-group.is-valid .input-icon-status::after {
    display: block;
    background: #22c55e;
    mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    mask-size: 10px;
    mask-position: center;
    mask-repeat: no-repeat;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    -webkit-mask-size: 10px;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
}

.form-group.is-invalid .input-icon-status::after {
    display: block;
    background: #ef4444;
    mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' xmlns='http://www.w3.org/2000/svg'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
    mask-size: 10px;
    mask-position: center;
    mask-repeat: no-repeat;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' xmlns='http://www.w3.org/2000/svg'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
    -webkit-mask-size: 10px;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
}

/* ─── Toggle Password Button ─────────────────────────────────────────────── */

.toggle-password {
    position: absolute;
    right: 0.625rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-secondary, #a0a0b0);
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    z-index: 1;
}

.toggle-password:hover {
    color: var(--text-primary, #e0e0e0);
}

/* ─── Form Hints & Errors ────────────────────────────────────────────────── */

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted, #666680);
    margin: 0;
    line-height: 1.4;
}

.form-error {
    font-size: 0.8rem;
    color: #ef4444;
    margin: 0;
    min-height: 0;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.form-error:empty {
    display: none;
}

/* ─── Password Strength ──────────────────────────────────────────────────── */

.password-strength {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.125rem;
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: var(--bg-tertiary, #0f0f1a);
    border-radius: 2px;
    overflow: hidden;
}

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

.strength-fill[data-score="0"] { width: 0; background: transparent; }
.strength-fill[data-score="1"] { width: 25%; background: #ef4444; }
.strength-fill[data-score="2"] { width: 50%; background: #f59e0b; }
.strength-fill[data-score="3"] { width: 75%; background: #22c55e; }
.strength-fill[data-score="4"] { width: 100%; background: #10b981; }

.strength-text {
    font-size: 0.75rem;
    color: var(--text-muted, #666680);
    min-width: 3.5rem;
    text-align: right;
}

/* ─── Submit Button ──────────────────────────────────────────────────────── */

.btn-full {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.1s ease;
    margin-top: 0.5rem;
}

.btn-primary {
    background: var(--accent-primary, #00bcd4);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-primary-hover, #0097a7);
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.985);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

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

/* ─── Auth Footer ────────────────────────────────────────────────────────── */

.auth-footer {
    text-align: center;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-primary, rgba(255, 255, 255, 0.08));
}

.auth-footer p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary, #a0a0b0);
}

.auth-link {
    color: var(--accent-primary, #00bcd4);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: var(--accent-primary-hover, #0097a7);
    text-decoration: underline;
}

/* ─── Shake Animation (for errors) ───────────────────────────────────────── */

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}

.auth-card.shake {
    animation: shake 0.4s ease;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 520px) {
    .auth-page {
        padding: 1rem 0.75rem;
        align-items: flex-start;
        padding-top: 2rem;
    }

    .auth-card {
        max-width: 100%;
        padding: 2rem 1.25rem;
        border-radius: 12px;
    }

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

/* ─── Light Theme Overrides ──────────────────────────────────────────────── */

[data-theme="light"] .auth-card {
    background: var(--bg-secondary, #ffffff);
    border-color: var(--border-primary, rgba(0, 0, 0, 0.1));
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .form-input {
    background: var(--bg-tertiary, #f5f5f7);
    border-color: var(--border-primary, rgba(0, 0, 0, 0.15));
    color: var(--text-primary, #1a1a2e);
}

[data-theme="light"] .form-input::placeholder {
    color: var(--text-muted, #999);
}

[data-theme="light"] .strength-bar {
    background: var(--bg-tertiary, #eee);
}
