/* ========================================
   instig-otp — 前台短代碼樣式
   ======================================== */

/* Container card */
.instig-otp-form {
    max-width: 100%;
    margin: 2rem 0;
    padding: 2rem 2.5rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,.06);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #1e293b;
}

/* Headings inside card */
.instig-otp-form h2 {
    margin: 0 0 1.25rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: .75rem;
}
.instig-otp-form h3 {
    margin: 1.5rem 0 .5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #334155;
}

/* Sections (account dashboard) */
.instig-otp-form section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}
.instig-otp-form section:last-child {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Labels */
.instig-otp-form label {
    display: block;
    margin: 1rem 0 .35rem;
    font-weight: 600;
    font-size: .9rem;
    color: #475569;
}

/* Text inputs, selects */
.instig-otp-form input[type="text"],
.instig-otp-form input[type="email"],
.instig-otp-form input[type="tel"],
.instig-otp-form input[type="password"],
.instig-otp-form input[type="date"],
.instig-otp-form select {
    width: 100%;
    padding: .65rem .9rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: .95rem;
    color: #1e293b;
    background: #f8fafc;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
}
.instig-otp-form input:focus,
.instig-otp-form select:focus {
    outline: none;
    border-color: #E3C27A;
    box-shadow: 0 0 0 3px rgba(227,194,122,.35);
    background: #fff;
}

/* OTP 6-digit input */
.instig-otp-form .otp-input {
    text-align: center;
    letter-spacing: .6em;
    font-size: 1.75rem;
    font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
    padding: .75rem 1rem;
    background: #f1f5f9;
    font-weight: 700;
}
.instig-otp-form .otp-input:focus {
    background: #fff;
}

/* Checkboxes */
.instig-otp-form input[type="checkbox"] {
    margin-right: .4rem;
    accent-color: #E3C27A;
    transform: scale(1.15);
    vertical-align: middle;
}

/* Primary buttons */
.instig-otp-form button,
.instig-otp-form .instig-otp-btn {
    display: block;
    width: 100%;
    margin-top: 1.25rem;
    padding: .75rem 1.25rem;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, #E3C27A, #C9A355);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .1s, box-shadow .2s;
    text-align: center;
}
.instig-otp-form button:hover:not(:disabled) {
    background: linear-gradient(135deg, #C9A355, #A88636);
    box-shadow: 0 4px 12px rgba(201,163,85,.4);
    transform: translateY(-1px);
}
.instig-otp-form button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}
.instig-otp-form button:disabled {
    opacity: .5;
    cursor: not-allowed;
    background: #94a3b8;
}

/* Secondary / resend button */
.instig-otp-form button[data-action="resend"],
.instig-otp-form button[data-action="cancel"] {
    background: transparent;
    color: #A88636;
    border: 1.5px solid #E3C27A;
    margin-top: .75rem;
    font-size: .9rem;
}
.instig-otp-form button[data-action="resend"],
.instig-otp-form button[data-action="cancel"]:hover:not(:disabled) {
    background: #FBF6EA;
    box-shadow: none;
    transform: none;
}
.instig-otp-form button[data-action="resend"],
.instig-otp-form button[data-action="cancel"]:disabled {
    opacity: .5;
    background: transparent;
    color: #94a3b8;
    border-color: #cbd5e1;
}

/* Hint text */
.instig-otp-hint {
    color: #64748b;
    font-size: .82rem;
    margin-top: .3rem;
    line-height: 1.4;
}

/* Error text */
.instig-otp-error {
    color: #dc2626;
    font-size: .88rem;
    margin-top: .5rem;
    min-height: 1.2em;
    font-weight: 500;
}

/* Step toggle */
.instig-otp-step {
    display: none;
}
.instig-otp-step.active {
    display: block;
    animation: instigFadeIn .3s ease;
}
@keyframes instigFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Account dashboard profile rows */
.instig-otp-form p {
    margin: .4rem 0;
    font-size: .95rem;
}
.instig-otp-form p strong {
    color: #475569;
    min-width: 4.5em;
    display: inline-block;
}

/* Links */
.instig-otp-form a {
    color: #A88636;
    text-decoration: none;
    font-weight: 500;
}
.instig-otp-form a:hover {
    text-decoration: underline;
    color: #8B6B22;
}

/* Footer links (login page bottom) */
.instig-otp-form p:last-child {
    text-align: center;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
    color: #64748b;
}

/* Toast notifications */
.instig-otp-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: .85rem 1.5rem;
    background: #334155;
    color: #fff;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity .3s, transform .3s;
    transform: translateY(-10px);
    z-index: 99999;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    max-width: 360px;
}
.instig-otp-toast.show {
    opacity: 1;
    transform: translateY(0);
}
.instig-otp-toast--success { background: #16a34a; }
.instig-otp-toast--error   { background: #dc2626; }

/* ========================================
   Dashboard layout
   ======================================== */

.instig-otp-dashboard {
    max-width: 100%;
    margin: 2rem 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", sans-serif;
    color: #1e293b;
}

/* Header banner */
.instig-dash-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.75rem 2rem;
    background: linear-gradient(135deg, #8B6B22, #C9A355);
    border-radius: 14px;
    color: #fff;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(139,107,34,.3);
}
.instig-dash-avatar img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,.4);
    object-fit: cover;
}
.instig-dash-greeting {
    flex: 1;
}
.instig-dash-greeting h2 {
    margin: 0 0 .2rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    border: 0;
    padding: 0;
}
.instig-dash-meta {
    font-size: .85rem;
    opacity: .8;
}
.instig-dash-logout {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 1rem;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 8px;
    color: #fff;
    font-size: .88rem;
    font-weight: 500;
    text-decoration: none;
    transition: background .2s;
    white-space: nowrap;
}
.instig-dash-logout:hover {
    background: rgba(255,255,255,.25);
    text-decoration: none;
    color: #fff;
}

/* Card grid */
.instig-dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

/* Individual card */
.instig-dash-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    box-shadow: 0 2px 12px rgba(0,0,0,.04);
    transition: box-shadow .2s, transform .15s;
}
.instig-dash-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.08);
    transform: translateY(-2px);
}

/* Card icon */
.instig-dash-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #FBF6EA;
    color: #A88636;
    margin-bottom: .75rem;
}
.instig-dash-card-icon--phone {
    background: #f0fdf4;
    color: #16a34a;
}
.instig-dash-card-icon--password {
    background: #fef3c7;
    color: #d97706;
}

.instig-otp-dashboard .instig-dash-card h3 {
    margin: 0 0 1rem;
    padding: 0;
    border: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #0f172a;
    background: transparent;
}

/* Info table inside card — high specificity to defeat theme CSS */
.instig-otp-dashboard .instig-dash-info,
.instig-otp-dashboard table.instig-dash-info {
    width: 100%;
    margin: 0;
    border: 0;
    border-collapse: collapse;
    background: transparent;
    table-layout: auto;
}
.instig-otp-dashboard .instig-dash-info tr,
.instig-otp-dashboard .instig-dash-info tbody tr {
    background: transparent !important;
}
.instig-otp-dashboard .instig-dash-info th,
.instig-otp-dashboard .instig-dash-info td,
.instig-otp-dashboard .instig-dash-info tbody th,
.instig-otp-dashboard .instig-dash-info tbody td {
    padding: .6rem 0;
    margin: 0;
    font-size: .92rem;
    line-height: 1.4;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    background: transparent;
    text-align: left;
    vertical-align: middle;
}
.instig-otp-dashboard .instig-dash-info tr:last-child th,
.instig-otp-dashboard .instig-dash-info tr:last-child td {
    border-bottom: 0;
}
.instig-otp-dashboard .instig-dash-info th {
    color: #64748b;
    font-weight: 500;
    width: 5em;
    white-space: nowrap;
}
.instig-otp-dashboard .instig-dash-info td {
    color: #1e293b;
    font-weight: 600;
    word-break: break-all;
}

/* update-phone form inside dashboard card: override card width */
.instig-dash-card .instig-otp-form {
    max-width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

/* Responsive */
@media (max-width: 680px) {
    .instig-dash-grid {
        grid-template-columns: 1fr;
    }
    .instig-dash-header {
        flex-wrap: wrap;
        padding: 1.25rem 1.5rem;
    }
    .instig-dash-logout {
        width: 100%;
        justify-content: center;
        margin-top: .5rem;
    }
}

@media (max-width: 560px) {
    .instig-otp-form {
        margin: 1rem 0;
        padding: 1.5rem 1.25rem;
        border-radius: 8px;
    }
    .instig-otp-form h2 { font-size: 1.25rem; }
    .instig-otp-form .otp-input { font-size: 1.4rem; letter-spacing: .4em; }
    .instig-otp-dashboard { margin: 1rem 0; }
    .instig-dash-header { border-radius: 10px; }
    .instig-dash-card { padding: 1.25rem; }
}
