/* ═══ Trip2Where Auth Modal v2 — Antigravity Design ═══ */

.t2w-auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.3s;
}
.t2w-auth-overlay.visible { opacity: 1; }

.t2w-auth-modal {
    background: #fff;
    border-radius: 28px;
    width: 400px;
    max-width: calc(100vw - 32px);
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.96);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 24px 48px -12px rgba(17, 24, 39, 0.18);
}
.t2w-auth-overlay.visible .t2w-auth-modal {
    transform: translateY(0) scale(1);
}

.t2w-auth-modal-body {
    padding: 40px 32px 32px;
    overflow-y: auto;
}

/* Close */
.t2w-auth-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f4f5f7;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
    transition: all 0.2s;
    z-index: 10;
}
.t2w-auth-close:hover { background: #e5e7eb; color: #111827; }
.t2w-auth-close .material-symbols-outlined { font-size: 20px; }

/* Header */
.t2w-auth-header { margin-bottom: 28px; }
.t2w-auth-icon {
    width: 52px;
    height: 52px;
    background: rgba(255, 183, 0, 0.1);
    color: #FFB700;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}
.t2w-auth-icon .material-symbols-outlined { font-size: 28px; }
.t2w-auth-title {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    line-height: 1.4;
    margin: 0;
    letter-spacing: -0.02em;
}
.t2w-auth-subtitle {
    font-size: 14px;
    color: #4b5563;
    margin-top: 8px;
    line-height: 1.5;
}

/* Tabs — pill with slider */
.t2w-auth-tabs {
    display: flex;
    background: #f4f5f7;
    border-radius: 9999px;
    padding: 4px;
    margin-bottom: 28px;
    position: relative;
}
.t2w-auth-tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
    cursor: pointer;
    border-radius: 9999px;
    transition: color 0.3s;
    position: relative;
    z-index: 2;
    text-align: center;
}
.t2w-auth-tab.active { color: #111827; }
.t2w-auth-tab-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: #fff;
    border-radius: 9999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 1;
}
.t2w-auth-tabs[data-active="register"] .t2w-auth-tab-indicator {
    transform: translateX(100%);
}

/* Social buttons */
.t2w-auth-social { display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; }
.t2w-auth-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 50px;
    border-radius: 9999px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s, box-shadow 0.2s;
    font-family: inherit;
    width: 100%;
}
.t2w-auth-social-btn:active { transform: scale(0.98); }
.t2w-auth-social-btn svg { flex-shrink: 0; }
.t2w-auth-social--kakao { background: #FEE500; color: rgba(0, 0, 0, 0.85); }
.t2w-auth-social--kakao:hover { background: #F4DC00; }
.t2w-auth-social--naver { background: #03C75A; color: #fff; }
.t2w-auth-social--naver:hover { background: #02B852; }
.t2w-auth-social-row { display: flex; gap: 12px; }
.t2w-auth-social-row .t2w-auth-social-btn { flex: 1; }
.t2w-auth-social--google { background: #fff; color: #111827; border: 1px solid #e5e7eb; }
.t2w-auth-social--google:hover { background: #f4f5f7; }
.t2w-auth-social--apple { background: #000; color: #fff; }
.t2w-auth-social--apple:hover { background: #111; }

/* Social consent */
.t2w-auth-social-consent { font-size: 11px; color: #9ca3af; text-align: center; margin: -16px 0 20px; line-height: 1.5; }
.t2w-auth-social-consent a { color: #6b7280; text-decoration: underline; }

/* Divider */
.t2w-auth-divider {
    display: flex;
    align-items: center;
    color: #9ca3af;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 24px;
}
.t2w-auth-divider::before, .t2w-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}
.t2w-auth-divider::before { margin-right: 12px; }
.t2w-auth-divider::after { margin-left: 12px; }

/* Form fields */
.t2w-auth-field { margin-bottom: 20px; }
.t2w-auth-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
}
.t2w-auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.t2w-auth-input-wrap .material-symbols-outlined {
    position: absolute;
    left: 16px;
    font-size: 20px;
    color: #9ca3af;
    transition: color 0.3s;
    z-index: 1;
}
.t2w-auth-input-wrap input {
    width: 100%;
    height: 52px;
    padding: 0 16px 0 44px;
    background: #f4f5f7;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 15px;
    color: #111827;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}
.t2w-auth-input-wrap input::placeholder { color: #9ca3af; }
.t2w-auth-input-wrap input:hover { background: #eaecef; }
.t2w-auth-input-wrap input:focus {
    background: #fff;
    border-color: #FFB700;
    box-shadow: 0 0 0 4px rgba(255, 183, 0, 0.1);
}
.t2w-auth-input-wrap input:focus ~ .material-symbols-outlined,
.t2w-auth-input-wrap input:focus + .material-symbols-outlined {
    color: #FFB700;
}
/* icon on the left needs to respond to sibling focus */
.t2w-auth-input-wrap:focus-within > .material-symbols-outlined:first-child { color: #FFB700; }

.t2w-auth-pw-toggle {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 4px;
    display: flex;
    transition: color 0.2s;
    z-index: 1;
}
.t2w-auth-pw-toggle:hover { color: #4b5563; }
.t2w-auth-pw-toggle .material-symbols-outlined { font-size: 20px; }
.t2w-auth-input-wrap input[type="password"],
.t2w-auth-input-wrap input[type="text"].t2w-pw-visible {
    padding-right: 48px;
}

/* Password strength meter */
.t2w-auth-pw-strength { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.t2w-auth-pw-bar { flex: 1; height: 4px; background: #e5e7eb; border-radius: 2px; overflow: hidden; }
.t2w-auth-pw-bar-fill { height: 100%; width: 0; border-radius: 2px; transition: width 0.3s, background 0.3s; }
.t2w-auth-pw-bar-fill[data-level="weak"] { width: 33%; background: #EF4444; }
.t2w-auth-pw-bar-fill[data-level="medium"] { width: 66%; background: #F59E0B; }
.t2w-auth-pw-bar-fill[data-level="strong"] { width: 100%; background: #10B981; }
.t2w-auth-pw-label { font-size: 11px; font-weight: 600; min-width: 28px; }
.t2w-auth-pw-label[data-level="weak"] { color: #EF4444; }
.t2w-auth-pw-label[data-level="medium"] { color: #F59E0B; }
.t2w-auth-pw-label[data-level="strong"] { color: #10B981; }

/* Remember + Forgot */
.t2w-auth-remember {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}
.t2w-auth-remember label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
    cursor: pointer;
    user-select: none;
}
.t2w-auth-remember input[type="checkbox"] { display: none; }
.t2w-auth-checkbox-custom {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #fff;
    flex-shrink: 0;
}
.t2w-auth-checkbox-custom .material-symbols-outlined {
    font-size: 16px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s;
}
input[type="checkbox"]:checked + .t2w-auth-checkbox-custom {
    background: #FFB700;
    border-color: #FFB700;
}
input[type="checkbox"]:checked + .t2w-auth-checkbox-custom .material-symbols-outlined {
    opacity: 1;
    transform: scale(1);
}
.t2w-auth-remember a {
    font-size: 13px;
    color: #4b5563;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.t2w-auth-remember a:hover { color: #FFB700; }

/* Terms checkboxes */
.t2w-auth-terms { margin-bottom: 20px; display: flex; flex-direction: column; gap: 10px; }
.t2w-auth-check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #4b5563;
    cursor: pointer;
    line-height: 1.4;
    user-select: none;
}
.t2w-auth-check input[type="checkbox"] { display: none; }
.t2w-auth-check .t2w-auth-checkbox-custom {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #fff;
    flex-shrink: 0;
}
.t2w-auth-check .t2w-auth-checkbox-custom .material-symbols-outlined {
    font-size: 16px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s;
}
.t2w-auth-check input[type="checkbox"]:checked + .t2w-auth-checkbox-custom {
    background: #FFB700;
    border-color: #FFB700;
}
.t2w-auth-check input[type="checkbox"]:checked + .t2w-auth-checkbox-custom .material-symbols-outlined {
    opacity: 1;
    transform: scale(1);
}
.t2w-auth-check a { color: #FFB700; text-decoration: underline; }

/* All-agree */
.t2w-auth-check--all { font-weight: 700; font-size: 14px; color: #111827; }
.t2w-auth-terms-divider { height: 1px; background: #e5e7eb; margin: 2px 0; }

/* Error state */
.t2w-auth-input-wrap.has-error input { border-color: #EF4444; }
.t2w-auth-input-wrap.has-error input:focus { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1); }
.t2w-auth-field-error { font-size: 11px; color: #EF4444; margin-top: 4px; display: none; }

/* Error banner */
.t2w-auth-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 13px;
    color: #dc2626;
    margin-bottom: 16px;
}

/* Submit — pill */
.t2w-auth-submit {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 9999px;
    background: #FFB700;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(255, 183, 0, 0.35);
    position: relative;
    overflow: hidden;
}
.t2w-auth-submit:hover {
    background: #F2AE00;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 183, 0, 0.45);
}
.t2w-auth-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 183, 0, 0.3);
}
.t2w-auth-submit:disabled { background: #e5e7eb; color: #9ca3af; cursor: not-allowed; transform: none; box-shadow: none; }
.t2w-auth-submit .material-symbols-outlined { font-size: 20px; }

/* Loading spinner */
@keyframes t2w-spin { to { transform: rotate(360deg); } }
.t2w-spin { animation: t2w-spin 1s linear infinite; }

/* Toast */
.t2w-auth-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: #111827;
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.t2w-auth-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Shake */
@keyframes t2w-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}
.t2w-auth-shake { animation: t2w-shake 0.4s ease; }

/* ═══ Mobile: bottom sheet ═══ */
@media (max-width: 640px) {
    .t2w-auth-overlay { align-items: flex-end; padding: 0; }
    .t2w-auth-modal {
        width: 100%;
        max-width: 100%;
        border-radius: 32px 32px 0 0;
        max-height: 92vh;
        transform: translateY(100%);
    }
    .t2w-auth-overlay.visible .t2w-auth-modal { transform: translateY(0); }
    .t2w-auth-modal::before {
        content: '';
        position: absolute;
        top: 12px;
        left: 50%;
        transform: translateX(-50%);
        width: 48px;
        height: 5px;
        background: #e5e7eb;
        border-radius: 3px;
        z-index: 10;
    }
    .t2w-auth-modal-body { padding: 40px 24px 32px; }
    .t2w-auth-title { font-size: 20px; }
}
