/**
 * CKit Guest Menu
 *
 * Pill icon button, dropdown panel, sign-in modal, welcome toast.
 * Responsive down to 320px. No em dashes in any content.
 */

/* --- Root container --- */
.hrck-guest-menu {
    position: relative;
    display: inline-block;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    color: #0f172a;
}

/* --- Pill icon button --- */
.hrck-guest-menu-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px 6px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.2s, border-color 0.2s;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    line-height: 1;
}
.hrck-guest-menu-button:hover,
.hrck-guest-menu-button:focus-visible {
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
    outline: none;
}

.hrck-guest-menu-hamburger {
    display: inline-flex;
    flex-direction: column;
    gap: 3px;
}
.hrck-guest-menu-hamburger span {
    width: 14px;
    height: 1.5px;
    background: #0f172a;
    border-radius: 1px;
}

.hrck-guest-menu-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #64748b;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}
.hrck-guest-menu-avatar--signed-in {
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
}

/* --- Dropdown panel --- */
.hrck-guest-menu-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 260px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    padding: 6px;
    z-index: 9999;
}
.hrck-guest-menu-dropdown[hidden] { display: none; }

.hrck-guest-menu-dropdown::before {
    content: '';
    position: absolute;
    top: -5px;
    right: 20px;
    width: 10px;
    height: 10px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    border-left: 1px solid #e2e8f0;
    transform: rotate(45deg);
}

/* --- Signed-in account card --- */
.hrck-guest-menu-account {
    padding: 12px 14px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.hrck-guest-menu-account-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.hrck-guest-menu-account-meta {
    min-width: 0;
    line-height: 1.3;
}
.hrck-guest-menu-account-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hrck-guest-menu-account-email {
    font-size: 11px;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hrck-guest-menu-sep {
    height: 1px;
    background: #e2e8f0;
    margin: 6px 10px;
}

/* --- Menu items --- */
.hrck-guest-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 13px;
    color: #0f172a;
    border-radius: 8px;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: inherit;
}
.hrck-guest-menu-item:hover,
.hrck-guest-menu-item:focus-visible {
    background: #f1f5f9;
    outline: none;
    color: #0f172a;
}

.hrck-guest-menu-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    display: inline-block;
}

/* --- Sign-in modal --- */
.hrck-guest-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.hrck-guest-modal[hidden] { display: none; }

.hrck-guest-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    cursor: pointer;
}

.hrck-guest-modal-dialog {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    padding: 32px 28px 24px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.25);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}

.hrck-guest-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.hrck-guest-modal-close:hover { background: #e2e8f0; color: #0f172a; }

.hrck-guest-modal-headline {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}
.hrck-guest-modal-subtitle {
    margin: 0 0 20px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

.hrck-guest-modal-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #334155;
    margin-bottom: 6px;
}
.hrck-guest-modal-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    box-sizing: border-box;
    color: #0f172a;
    font-family: inherit;
    margin-bottom: 12px;
}
.hrck-guest-modal-input:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}
.hrck-guest-modal-error {
    font-size: 12px;
    color: #dc2626;
    margin-bottom: 12px;
    line-height: 1.4;
}
.hrck-guest-modal-error[hidden] { display: none; }

.hrck-guest-modal-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 20px;
}
.hrck-guest-modal-consent input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
}

.hrck-guest-modal-submit {
    display: block;
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.hrck-guest-modal-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.hrck-guest-modal-legal {
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
    margin: 14px 0 0;
    line-height: 1.5;
}
.hrck-guest-modal-legal a { color: #64748b; text-decoration: underline; }

/* --- Modal success state --- */
.hrck-guest-modal-state--success { text-align: center; padding: 12px 0 4px; }
.hrck-guest-modal-state--success[hidden] { display: none; }

.hrck-guest-modal-success-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e, #10b981);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: #fff;
}
.hrck-guest-modal-email {
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 4px;
}
.hrck-guest-modal-helper {
    margin-top: 12px;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.5;
}

.hrck-guest-modal-success-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}
.hrck-guest-modal-success-actions button {
    background: none;
    border: none;
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    font-family: inherit;
}
.hrck-guest-modal-resend {
    color: #0ea5e9 !important;
    font-weight: 600;
}
.hrck-guest-modal-resend:disabled {
    color: #94a3b8 !important;
    cursor: not-allowed;
}

/* --- Welcome toast --- */
.hrck-guest-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: #0f172a;
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.25);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 100001;
    pointer-events: none;
}
.hrck-guest-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Stream 2: contextual label shown when sign-in is triggered by a tool */
.hrck-guest-modal-context-label {
    font-size: 13px;
    color: #717171;
    margin: -4px 0 12px;
    text-align: center;
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .hrck-guest-menu-dropdown {
        right: 0;
        left: auto;
        min-width: 240px;
    }
    .hrck-guest-modal-dialog {
        padding: 24px 20px 20px;
    }
}
