/* Auth modal styles */
.auth-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 24px;
}

.auth-modal.is-open {
    display: flex;
}

.auth-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 520px;
    background: var(--bg-primary, #0d1b2a);
    color: var(--text-primary, #e9eef4);
    border-radius: var(--radius-lg, 20px);
    box-shadow: var(--shadow-lg, 0 20px 60px rgba(0,0,0,0.4));
    padding: 32px;
    border: 1px solid var(--border-color, rgba(255,255,255,0.08));
    backdrop-filter: blur(10px);
}

.auth-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
    background: rgba(255,255,255,0.04);
    color: inherit;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all .2s ease;
}

.auth-modal__close:hover {
    background: rgba(255,255,255,0.1);
    transform: scale(1.05);
}

.auth-modal__header .eyebrow {
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 12px;
    color: var(--primary-color, #0076a8);
    font-weight: 700;
}

.auth-modal__header h2 {
    margin: 6px 0 6px;
    font-size: 26px;
}

.auth-modal__header p {
    color: var(--text-secondary, #9fb3c8);
    margin: 0 0 18px;
    line-height: 1.6;
}

.auth-modal__form .form-field {
    margin-bottom: 16px;
}

.auth-modal__form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.input-shell {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color, rgba(255,255,255,0.08));
    border-radius: 12px;
    padding: 10px 12px;
}

.input-shell input {
    width: 100%;
    background: transparent;
    border: none;
    color: inherit;
    font-size: 14px;
    outline: none;
}

/* Scope modal input styling to prevent global auth form rules making it tall */
.auth-modal .input-shell {
    position: relative;
    display: flex;
    align-items: center;
    height: 46px;
    min-height: 46px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-color, rgba(255,255,255,0.12));
    background: rgba(255,255,255,0.04);
    box-shadow: none;
    transition: box-shadow .2s ease, border-color .2s ease, background .2s ease;
}

.auth-modal .input-shell:focus-within {
    border-color: var(--primary-color, #0076a8);
    box-shadow: 0 0 0 3px rgba(0,118,168,0.18);
    background: rgba(255,255,255,0.06);
}

.auth-modal .input-shell .input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--text-secondary, #9fb3c8);
    pointer-events: none;
}

.auth-modal .input-shell input {
    width: 100%;
    height: 100%;
    padding: 0 12px 0 38px;
    border: none;
    background: transparent;
    color: inherit;
    font-size: 14px;
    line-height: 1.4;
    outline: none;
    box-shadow: none;
}

.auth-modal .input-shell.has-action {
    padding-right: 48px;
}

.auth-modal .field-action {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-secondary, #9fb3c8);
    padding: 6px;
    border-radius: 10px;
    cursor: pointer;
    transition: all .18s ease;
}

.auth-modal .field-action:hover,
.auth-modal .field-action.active {
    color: var(--primary-color, #0076a8);
    background: rgba(255,255,255,0.08);
}

.input-icon {
    margin-right: 10px;
    color: var(--text-secondary, #9fb3c8);
}

.has-action .field-action {
    background: none;
    border: none;
    color: var(--text-secondary, #9fb3c8);
    cursor: pointer;
    padding: 6px;
}

.captcha-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.auth-modal .captcha-row .input-shell {
    flex: 1;
    min-width: 0;
}

.auth-modal .captcha-visual {
    position: relative;
    width: 180px;
    max-width: 200px;
    height: 46px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(0, 118, 168, 0.22), rgba(255, 127, 0, 0.12));
    border: 1px solid var(--border-color, rgba(255,255,255,0.12));
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: all .2s ease;
}

.auth-modal .captcha-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 25% 25%, rgba(255,255,255,0.28), transparent 42%),
                radial-gradient(circle at 80% 10%, rgba(0,118,168,0.3), transparent 45%),
                linear-gradient(120deg, rgba(255,255,255,0.1), rgba(255,255,255,0));
    pointer-events: none;
}

.auth-modal .captcha-visual:hover {
    transform: translateY(-1px);
    border-color: var(--primary-color, #0076a8);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
}

.auth-modal .captcha-visual:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,118,168,0.26), 0 12px 30px rgba(0, 0, 0, 0.35);
    border-color: var(--primary-color, #0076a8);
}

.auth-modal .captcha-img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    border: none;
    object-fit: cover;
    display: block;
    filter: contrast(108%);
}

.auth-modal__submit {
    width: 100%;
    margin-top: 8px;
}

.auth-switch {
    text-align: center;
    margin-top: 14px;
    color: var(--text-secondary, #9fb3c8);
}

.auth-switch a {
    color: var(--primary-color, #0076a8);
    font-weight: 600;
}

/* Header buttons for login/register */
.user .modal-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-full, 999px);
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.08);
    color: inherit;
    transition: all .2s ease;
    text-decoration: none;
}

.user .modal-trigger:hover {
    background: rgba(255,255,255,0.16);
    transform: translateY(-1px);
}

.user .modal-trigger.regist {
    background: var(--primary-gradient, linear-gradient(135deg,#0076a8,#004d6d));
    color: #fff;
    border: none;
    box-shadow: 0 8px 24px rgba(0,118,168,0.24);
}

.user .modal-trigger.regist:hover {
    box-shadow: 0 12px 30px rgba(0,118,168,0.28);
}

@media (max-width: 540px) {
    .auth-modal__dialog {
        padding: 24px;
    }
}

/* Toast Notification Styles */
.auth-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    min-width: 320px;
    max-width: 420px;
    background: var(--bg-primary, #0d1b2a);
    color: var(--text-primary, #e9eef4);
    border-radius: var(--radius-lg, 16px);
    box-shadow: var(--shadow-lg, 0 20px 60px rgba(0,0,0,0.4));
    padding: 18px 20px;
    border: 1px solid var(--border-color, rgba(255,255,255,0.08));
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.auth-toast.is-visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.auth-toast.is-hiding {
    opacity: 0;
    transform: translateX(400px);
}

.auth-toast__icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    margin-top: 2px;
}

.auth-toast--error .auth-toast__icon {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.auth-toast--success .auth-toast__icon {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.auth-toast--warning .auth-toast__icon {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.auth-toast--info .auth-toast__icon {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.auth-toast__content {
    flex: 1;
    min-width: 0;
}

.auth-toast__title {
    font-weight: 700;
    font-size: 15px;
    margin: 0 0 4px;
    line-height: 1.4;
}

.auth-toast__message {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary, #9fb3c8);
    margin: 0;
    word-wrap: break-word;
}

.auth-toast__close {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary, #9fb3c8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    padding: 0;
    transition: all 0.2s ease;
    margin-top: 2px;
}

.auth-toast__close:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary, #e9eef4);
}

.auth-toast__close i {
    font-size: 12px;
}

@media (max-width: 540px) {
    .auth-toast {
        top: 16px;
        right: 16px;
        left: 16px;
        min-width: auto;
        max-width: none;
        transform: translateY(-100px);
    }

    .auth-toast.is-visible {
        transform: translateY(0);
    }

    .auth-toast.is-hiding {
        transform: translateY(-100px);
    }
}

