/* =====================================================
   JIA COREANO - Auth Modal (Login / Register)
   ===================================================== */

.jc-auth-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 16px;
}
.jc-auth-overlay.jc-auth-open {
    display: flex;
}

.jc-auth-modal {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 60px rgba(0,0,0,0.2);
    animation: jcModalIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes jcModalIn {
    from { opacity: 0; transform: scale(0.92) translateY(16px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.jc-auth-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: background 0.15s, color 0.15s;
    z-index: 2;
}
.jc-auth-close:hover { background: #ffe0e7; color: #d4637a; }

/* Tabs */
.jc-auth-tabs {
    display: flex;
    border-bottom: 2px solid #f0f0f0;
    padding: 20px 28px 0;
    gap: 4px;
}
.jc-auth-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 10px 0;
    font-size: 15px;
    font-weight: 600;
    color: #aaa;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}
.jc-auth-tab.active {
    color: #d4637a;
    border-bottom-color: #d4637a;
}

/* Panel */
.jc-auth-panel { display: none; padding: 24px 28px 28px; }
.jc-auth-panel.active { display: block; }

.jc-auth-header { margin-bottom: 20px; }
.jc-auth-header h2 { margin: 0 0 4px; font-size: 22px; font-weight: 700; }
.jc-auth-header p { margin: 0; color: #888; font-size: 14px; }

/* Error */
.jc-auth-error {
    background: #fff0f3;
    border: 1px solid #ffc2ce;
    border-radius: 8px;
    padding: 12px 14px;
    color: #c0392b;
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Fields */
.jc-field {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.jc-field label {
    font-size: 13px;
    font-weight: 600;
    color: #444;
}
.jc-field-hint { font-weight: 400; color: #aaa; margin-left: 4px; }

.jc-field input[type="text"],
.jc-field input[type="email"],
.jc-field input[type="password"] {
    width: 100%;
    height: 44px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    padding: 0 14px;
    font-size: 15px;
    color: #222;
    background: #fafafa;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
    outline: none;
    -webkit-appearance: none;
}
.jc-field input:focus {
    border-color: #d4637a;
    background: #fff;
}

.jc-field-password {
    position: relative;
    display: flex;
    align-items: center;
}
.jc-field-password input {
    padding-right: 44px;
    width: 100%;
}
.jc-toggle-pw {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.15s;
}
.jc-toggle-pw:hover { opacity: 1; }

.jc-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row !important;
    gap: 0;
}
.jc-field-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.jc-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
    font-weight: 400 !important;
    cursor: pointer;
}
.jc-checkbox-label input { width: auto; height: auto; margin: 0; }

.jc-forgot-link {
    font-size: 13px;
    color: #d4637a;
    text-decoration: none;
}
.jc-forgot-link:hover { text-decoration: underline; }

/* Password strength */
.jc-password-strength {
    font-size: 12px;
    font-weight: 600;
    height: 14px;
    transition: color 0.2s;
}
.jc-pw-match-msg {
    font-size: 12px;
    font-weight: 600;
    height: 14px;
}

/* Submit */
.jc-btn-full {
    width: 100%;
    height: 48px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 12px;
    margin-top: 8px;
    letter-spacing: 0.3px;
}

/* Footer */
.jc-auth-switch {
    text-align: center;
    font-size: 14px;
    color: #888;
    margin: 16px 0 0;
}
.jc-auth-switch a { color: #d4637a; text-decoration: none; font-weight: 600; }
.jc-auth-switch a:hover { text-decoration: underline; }

.jc-auth-terms {
    text-align: center;
    font-size: 12px;
    color: #bbb;
    margin: 12px 0 0;
}
.jc-auth-terms a { color: #bbb; text-decoration: underline; }

/* ── Mobile fullscreen ── */
@media (max-width: 520px) {
    .jc-auth-overlay {
        padding: 0;
        align-items: flex-end;
    }
    .jc-auth-modal {
        border-radius: 20px 20px 0 0;
        max-height: 95vh;
        animation: jcModalInMobile 0.3s cubic-bezier(0.34,1.2,0.64,1);
    }
    @keyframes jcModalInMobile {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }
    .jc-field-row-2 { grid-template-columns: 1fr; gap: 0; }
}
