/* ==========================================================================
   Custom Registration & Login — frontend styles
   ========================================================================== */

/* --- Reset / base -------------------------------------------------------- */
.cr-wrap *,
.cr-wrap *::before,
.cr-wrap *::after {
    box-sizing: border-box;
}

/* --- Container ----------------------------------------------------------- */
.cr-wrap {
    --cr-accent:      #4f46e5;
    --cr-accent-h:    #4338ca;
    --cr-bg:          #ffffff;
    --cr-surface:     #f9fafb;
    --cr-border:      #e5e7eb;
    --cr-text:        #111827;
    --cr-muted:       #6b7280;
    --cr-error:       #dc2626;
    --cr-success:     #16a34a;
    --cr-radius:      10px;
    --cr-shadow:      0 4px 24px rgba(0,0,0,.08);

    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    max-width: 440px;
    margin: 3rem auto;
    background: var(--cr-bg);
    border: 1px solid var(--cr-border);
    border-radius: var(--cr-radius);
    box-shadow: var(--cr-shadow);
    overflow: hidden;
}

/* --- Tabs ---------------------------------------------------------------- */
.cr-tabs {
    display: flex;
    border-bottom: 1px solid var(--cr-border);
    background: var(--cr-surface);
}

.cr-tab {
    flex: 1;
    padding: .85rem 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: .95rem;
    font-weight: 500;
    color: var(--cr-muted);
    transition: color .2s, border-color .2s, background .2s;
}

.cr-tab:hover {
    color: var(--cr-accent);
    background: rgba(79,70,229,.04);
}

.cr-tab.active {
    color: var(--cr-accent);
    border-bottom-color: var(--cr-accent);
    background: var(--cr-bg);
}

/* --- Form panel ---------------------------------------------------------- */
.cr-form {
    display: none;
    padding: 2rem 2.25rem 2.25rem;
}

.cr-form.active {
    display: block;
    animation: crFadeIn .25s ease;
}

@keyframes crFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cr-form h2 {
    margin: 0 0 1.5rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--cr-text);
    letter-spacing: -.015em;
}

/* --- Fields -------------------------------------------------------------- */
.cr-field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin-bottom: 1.1rem;
}

.cr-field label {
    font-size: .875rem;
    font-weight: 500;
    color: var(--cr-text);
}

.cr-field input {
    width: 100%;
    padding: .65rem .85rem;
    border: 1px solid var(--cr-border);
    border-radius: 7px;
    font-size: .95rem;
    color: var(--cr-text);
    background: var(--cr-bg);
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}

.cr-field input:focus {
    border-color: var(--cr-accent);
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

.cr-hint {
    font-size: .78rem;
    color: var(--cr-muted);
    margin-top: .1rem;
}

/* --- OTP step ------------------------------------------------------------ */
.cr-otp-step {
    margin-bottom: 1.1rem;
}

/* --- Message area -------------------------------------------------------- */
.cr-msg {
    min-height: 1.2em;
    margin-bottom: .75rem;
    font-size: .875rem;
    border-radius: 6px;
    padding: 0;
    transition: all .2s;
}

.cr-msg.is-error {
    padding: .6rem .85rem;
    background: #fef2f2;
    color: var(--cr-error);
    border: 1px solid #fecaca;
}

.cr-msg.is-success {
    padding: .6rem .85rem;
    background: #f0fdf4;
    color: var(--cr-success);
    border: 1px solid #bbf7d0;
}

/* --- Button -------------------------------------------------------------- */
.cr-btn {
    display: block;
    width: 100%;
    padding: .75rem 1rem;
    background: var(--cr-accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: .975rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: .01em;
    transition: background .2s, transform .1s, box-shadow .2s;
    margin-bottom: .65rem;
}

.cr-btn:hover:not(:disabled) {
    background: var(--cr-accent-h);
    box-shadow: 0 4px 12px rgba(79,70,229,.25);
}

.cr-btn:active:not(:disabled) {
    transform: scale(.985);
}

.cr-btn:disabled {
    opacity: .65;
    cursor: not-allowed;
}

.cr-btn.cr-btn-loading::after {
    content: " …";
}

/* --- Alt link ------------------------------------------------------------ */
.cr-alt-link {
    text-align: center;
    font-size: .85rem;
    color: var(--cr-muted);
    margin: .5rem 0 0;
}

.cr-alt-link a {
    color: var(--cr-accent);
    text-decoration: none;
    font-weight: 500;
}

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

/* --- Utility ------------------------------------------------------------- */
.hidden {
    display: none !important;
}

/* --- reCAPTCHA badge placement ------------------------------------------ */
/* --- Google Button & Separator --- */
.cr-google-auth-wrap {
    margin-top: 1.5rem;
    padding: 0 1.25rem 1.5rem;
}

.cr-google-btn {
    background: #fff;
    color: #333;
    border: 1px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    transition: background 0.2s;
    font-weight: 500;
}
.cr-google-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #333;
}
.cr-google-btn img {
    width: 18px; 
    height: 18px;
    margin: 0;
    display: inline-block;
}

.cr-separator {
    margin: 0 0 1.5rem 0;
    text-align: center;
    border-bottom: 1px solid var(--cr-border);
    line-height: 0.1em;
}
.cr-separator span {
    background: var(--cr-bg, #fff);
    padding: 0 10px;
    color: var(--cr-muted);
    font-size: 0.85rem;
}

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 500px) {
    .cr-wrap {
        margin: 1rem;
        border-radius: 8px;
    }
    .cr-form {
        padding: 1.5rem 1.25rem;
    }
    .cr-google-auth-wrap {
        padding: 0 1.25rem 1.5rem;
    }
}

/* --- Widget specific overrides --- */
.cr-widget-wrap.cr-wrap {
    max-width: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    background: transparent;
}
