/* =====================================================
   auth.css — Enterprise Sign-In Modal (Professional)
   Clean email + OTP verification flow
   ===================================================== */

/* ── Overlay ─────────────────────────────────────── */
.dt-auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.dt-auth-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* ── Card ────────────────────────────────────────── */
.dt-auth-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 36px;
    width: 100%;
    max-width: 580px;
    position: relative;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18), 0 4px 16px rgba(0, 0, 0, 0.05);
    transform: translateY(14px) scale(0.98);
    transition: transform 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
    overflow-y: auto;
    max-height: 90vh;
}
.dt-auth-overlay.open .dt-auth-card {
    transform: translateY(0) scale(1);
}

/* ── Close button ────────────────────────────────── */
.dt-auth-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.dt-auth-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* ── Brand header ────────────────────────────────── */
.dt-auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}
.dt-auth-logo {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    object-fit: cover;
}
.dt-auth-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.dt-auth-brand-name {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.03em;
    line-height: 1;
}
.dt-auth-brand-sub {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1;
}

/* ── Headings ────────────────────────────────────── */
.dt-auth-heading {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.025em;
    margin-bottom: 6px;
}
.dt-auth-sub {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.55;
    margin-bottom: 24px;
}

/* ── Form Fields ─────────────────────────────────── */
.dt-field {
    margin-bottom: 16px;
}
.dt-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}
@media (max-width: 460px) {
    .dt-field-row { grid-template-columns: 1fr; }
}
.dt-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}
.dt-req { color: var(--green, #16a34a); }
.dt-input {
    width: 100%;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #0f172a;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}
.dt-input:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}
textarea.dt-input { resize: vertical; }
select.dt-input { cursor: pointer; }

/* ── Error text ──────────────────────────────────── */
.dt-error {
    font-size: 0.78rem;
    color: #dc2626;
    margin-top: 6px;
    min-height: 1.2em;
}

/* ── Google Sign-In Button ───────────────────────── */
.dt-btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 11px 20px;
    background: #ffffff;
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
    margin-bottom: 16px;
}
.dt-btn-google:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.dt-btn-google svg { flex-shrink: 0; }

/* ── Divider ─────────────────────────────────────── */
.dt-auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 18px 0;
}
.dt-auth-divider::before,
.dt-auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e2e8f0;
}
.dt-auth-divider span {
    padding: 0 12px;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* ── Primary button ──────────────────────────────── */
.dt-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 20px;
    background: #16a34a;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: background 0.15s, transform 0.1s;
    margin-top: 4px;
}
.dt-btn-primary:hover { background: #15803d; }
.dt-btn-primary:active { transform: scale(0.99); }

/* ── Single OTP Input ─────────────────────────────── */
.dt-otp-single {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.35em;
    padding: 14px 20px;
    color: #0f172a;
    height: 64px;
}
.dt-otp-single::placeholder {
    font-weight: 400;
    font-size: 1.2rem;
    letter-spacing: 0.3em;
    color: #cbd5e1;
}

/* ── Resend row ──────────────────────────────────── */
.dt-resend-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    margin-bottom: 16px;
    font-size: 0.8rem;
}
.dt-resend-timer { color: #64748b; }
.dt-resend-btn {
    background: none;
    border: none;
    color: #16a34a;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}
.dt-resend-btn:disabled { color: #94a3b8; cursor: not-allowed; }

/* ── Back link ───────────────────────────────────── */
.dt-back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 14px;
    background: none;
    border: none;
    font-size: 0.8rem;
    color: #64748b;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
    transition: color 0.15s;
}
.dt-back-link:hover { color: #0f172a; }

/* ── Footer note ─────────────────────────────────── */
.dt-auth-footer-note {
    font-size: 0.76rem;
    color: #94a3b8;
    text-align: center;
    margin-top: 18px;
    line-height: 1.5;
}
.dt-auth-footer-note a {
    color: #16a34a;
    font-weight: 500;
    text-decoration: none;
}
.dt-auth-footer-note a:hover { text-decoration: underline; }

/* ── Toast Notifications ─────────────────────────── */
.dt-toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #0f172a;
    border-radius: 12px;
    padding: 16px 20px;
    max-width: 360px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    z-index: 99999;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}
.dt-toast.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}
.dt-toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: rgba(74, 222, 128, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dt-toast-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 3px;
}
.dt-toast-sub {
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.4;
}

/* ── Signed-In User Pill ─────────────────────────── */
.nav-user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px 5px 6px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}
.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #16a34a;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.user-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: #0f172a;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-logout-btn {
    border: none;
    background: none;
    color: #94a3b8;
    font-size: 0.7rem;
    cursor: pointer;
    padding: 0 0 0 4px;
    transition: color 0.15s;
}
.user-logout-btn:hover { color: #0f172a; }
