/* TapPlaza Auth CSS — theme-independent, premium design */
/* tapplaza.com */

/* ── Wrapper — centers card on any theme ────────────────────────────── */
.tap-auth-wrap {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 60vh;
    padding: 32px 16px 60px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    background: transparent; /* fits any theme bg */
}

/* ── Card ────────────────────────────────────────────────────────────── */
.tap-auth-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(108, 63, 197, 0.12), 0 2px 8px rgba(0,0,0,.06);
    width: 100%;
    max-width: 480px;
    padding: 40px 36px;
    box-sizing: border-box;
    border: 1px solid rgba(108,63,197,.1);
}

/* ── Brand / Header ──────────────────────────────────────────────────── */
.tap-auth-brand {
    text-align: center;
    margin-bottom: 32px;
}
.tap-auth-logo {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, #6c3fc5, #5530a3);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 14px;
    color: white;
}
.tap-auth-brand h1 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 800;
    color: #1a202c;
    line-height: 1.2;
}
.tap-auth-brand p {
    margin: 0;
    font-size: 14px;
    color: #718096;
}

/* ── Form fields ─────────────────────────────────────────────────────── */
.tap-auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.tap-auth-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.tap-auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tap-auth-field label {
    font-size: 13px;
    font-weight: 600;
    color: #2d3748;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tap-auth-field label span { color: #e53e3e; font-size: 12px; }
.tap-optional { color: #a0aec0 !important; font-weight: 400 !important; font-size: 11px !important; }

.tap-auth-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    font-size: 15px;
    color: #2d3748;
    background: #fafafa;
    transition: border-color .2s, background .2s, box-shadow .2s;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}
.tap-auth-input:focus {
    border-color: #6c3fc5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(108,63,197,.12);
}
.tap-auth-input::placeholder { color: #a0aec0; font-size: 14px; }
.tap-auth-input.tap-input-error { border-color: #e53e3e; background: #fff5f5; }
.tap-auth-input.tap-input-ok    { border-color: #38a169; }

/* ── Password field ──────────────────────────────────────────────────── */
.tap-password-wrap { position: relative; }
.tap-password-wrap .tap-auth-input { padding-right: 44px; }
.tap-toggle-pw {
    position: absolute; right: 12px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none; cursor: pointer;
    font-size: 16px; padding: 4px; line-height: 1;
    opacity: .6; transition: opacity .2s;
}
.tap-toggle-pw:hover { opacity: 1; }

/* ── Phone field ─────────────────────────────────────────────────────── */
.tap-phone-wrap { display: flex; align-items: center; gap: 0; }
.tap-phone-prefix {
    padding: 11px 12px;
    background: #f7f8fc;
    border: 1.5px solid #e2e8f0;
    border-right: none;
    border-radius: 9px 0 0 9px;
    font-size: 13px;
    color: #4a5568;
    white-space: nowrap;
    flex-shrink: 0;
}
.tap-phone-input {
    border-radius: 0 9px 9px 0 !important;
    flex: 1;
}

/* ── Password strength ───────────────────────────────────────────────── */
.tap-pw-strength {
    height: 4px;
    border-radius: 2px;
    background: #e2e8f0;
    margin-top: 4px;
    transition: all .3s;
    overflow: hidden;
}
.tap-pw-strength::after {
    content: '';
    display: block;
    height: 100%;
    border-radius: 2px;
    transition: all .3s;
}
.tap-pw-strength.weak::after   { width: 33%; background: #e53e3e; }
.tap-pw-strength.fair::after   { width: 66%; background: #d69e2e; }
.tap-pw-strength.strong::after { width: 100%; background: #38a169; }

/* ── Checkbox ────────────────────────────────────────────────────────── */
.tap-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: #4a5568;
    line-height: 1.4;
}
.tap-checkbox-label input[type="checkbox"] { display: none; }
.tap-checkbox-custom {
    width: 18px; height: 18px;
    border: 2px solid #e2e8f0;
    border-radius: 5px;
    background: #fafafa;
    flex-shrink: 0;
    margin-top: 1px;
    transition: all .2s;
    display: flex; align-items: center; justify-content: center;
}
.tap-checkbox-label input:checked + .tap-checkbox-custom {
    background: #6c3fc5;
    border-color: #6c3fc5;
}
.tap-checkbox-label input:checked + .tap-checkbox-custom::after {
    content: '✓';
    color: white;
    font-size: 11px;
    font-weight: 700;
}
.tap-checkbox-label a { color: #6c3fc5; text-decoration: none; }
.tap-checkbox-label a:hover { text-decoration: underline; }

.tap-remember-row { flex-direction: row; align-items: center; }

/* ── Error & hint messages ───────────────────────────────────────────── */
.tap-field-error { font-size: 12px; color: #e53e3e; min-height: 16px; }
.tap-field-hint  { font-size: 12px; color: #a0aec0; }
.tap-forgot-link { font-size: 12px; color: #6c3fc5; text-decoration: none; font-weight: 400; }
.tap-forgot-link:hover { text-decoration: underline; }

/* ── Submit button ───────────────────────────────────────────────────── */
.tap-auth-btn {
    width: 100%;
    padding: 13px 20px;
    background: linear-gradient(135deg, #6c3fc5, #5530a3);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    font-family: inherit;
    text-decoration: none;
    margin-top: 4px;
    box-shadow: 0 4px 14px rgba(108,63,197,.3);
}
.tap-auth-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(108,63,197,.4);
    color: #fff;
    text-decoration: none;
}
.tap-auth-btn:active { transform: translateY(0); }
.tap-auth-btn:disabled { opacity: .65; cursor: not-allowed; transform: none; }
.tap-auth-btn-outline {
    background: transparent;
    border: 2px solid #6c3fc5;
    color: #6c3fc5;
    box-shadow: none;
}
.tap-auth-btn-outline:hover { background: #f0ebfa; color: #6c3fc5; box-shadow: none; }

/* ── Spinner ─────────────────────────────────────────────────────────── */
.tap-spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tap-spin .7s linear infinite;
    vertical-align: middle;
}
@keyframes tap-spin { to { transform: rotate(360deg); } }

/* ── Success state ───────────────────────────────────────────────────── */
.tap-auth-success-icon {
    font-size: 52px;
    text-align: center;
    margin-bottom: 16px;
}
#tap-reg-success h3,
#tap-fp-success h3,
#tap-rp-success h3 {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 12px;
}
#tap-reg-success p,
#tap-fp-success p,
#tap-rp-success p {
    text-align: center;
    font-size: 14px;
    color: #718096;
    line-height: 1.6;
    margin: 0 0 20px;
}
.tap-auth-hint { font-size: 12px !important; color: #a0aec0 !important; }

/* ── Info box ────────────────────────────────────────────────────────── */
.tap-auth-info-box {
    background: #ebf8ff;
    border: 1px solid #90cdf4;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
    color: #2a4365;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* ── Footer link ─────────────────────────────────────────────────────── */
.tap-auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: #718096;
    border-top: 1px solid #f0f0f0;
    padding-top: 20px;
}
.tap-auth-footer a { color: #6c3fc5; font-weight: 600; text-decoration: none; }
.tap-auth-footer a:hover { text-decoration: underline; }

/* ── Alert overrides for auth context ───────────────────────────────── */
.tap-auth-card .tap-alert {
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}
.tap-auth-card .tap-alert a { color: inherit; font-weight: 700; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 520px) {
    .tap-auth-card   { padding: 28px 20px; border-radius: 12px; }
    .tap-auth-row    { grid-template-columns: 1fr; }
    .tap-auth-brand h1 { font-size: 20px; }
}
@media (max-width: 380px) {
    .tap-auth-wrap   { padding: 16px 8px 40px; }
    .tap-auth-card   { padding: 24px 16px; }
}
