/* Shared passkey login styles — used wherever the login partial appears
   (account page, checkout, course booking, topbar modal …), so these rules
   are loaded globally on the frontend rather than with the account page. */

/* hidden host for the passkey login iframe — triggered by the fingerprint icon */
.passkey-frame-host {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* fingerprint passkey trigger — rendered as a borderless icon inside the email field */
.passkey-input {
    position: relative;
}

.passkey-input .form-control {
    padding-right: 38px;
}

.passkey-trigger {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: #999;
    cursor: pointer;
}

.passkey-trigger:hover,
.passkey-trigger:focus {
    color: #333;
    outline: none;
}

/* on hover the fingerprint lines turn Apple-red one after another.
   explicit base stroke so the lines never follow the trigger's hover color
   (otherwise they'd flash to the grey/black hover color before turning red) */
.passkey-icon path {
    stroke: #999;
    transition: stroke 0.18s ease;
}

/* hover anywhere over the email field (incl. the transparent overlay iframe) */
.passkey-input:hover .passkey-icon path {
    stroke: #ff3b30;
}

.passkey-input:hover .passkey-icon path:nth-child(1) {
    transition-delay: 0s;
}

.passkey-input:hover .passkey-icon path:nth-child(2) {
    transition-delay: 0.07s;
}

.passkey-input:hover .passkey-icon path:nth-child(3) {
    transition-delay: 0.14s;
}

.passkey-input:hover .passkey-icon path:nth-child(4) {
    transition-delay: 0.21s;
}

.passkey-input:hover .passkey-icon path:nth-child(5) {
    transition-delay: 0.28s;
}

/* transparent overlay iframe over the fingerprint icon — captures the click so
   the cross-origin get() runs inside the iframe (keeps focus/activation in Safari) */
.passkey-input .passkey-overlay {
    position: absolute;
    top: 0;
    right: 0;
    width: 38px;
    height: 100%;
    z-index: 3;
}

.passkey-input .passkey-overlay-frame {
    display: block !important; /* beat swal/theme iframe rules that force inline (→ 0×0, unclickable) */
    width: 100%;
    height: 100%;
    background: transparent;
}

/* post-login offer modal: large fingerprint + embedded register iframe.
   hovering anywhere on the dialog runs the lines red one after another */
.passkey-offer-modal .modal-dialog {
    width: 440px;
    max-width: calc(100% - 20px);
}

.passkey-offer-modal .modal-body {
    padding: 2em 1.5em;
}

.passkey-offer-icon {
    display: block;
    text-align: center;
    margin: 0 auto 1em;
}

.passkey-offer-title {
    margin: 0 0 0.4em;
}

.passkey-offer-text {
    color: #777;
    margin-bottom: 1.5em;
}

.passkey-offer-frame iframe {
    display: block;
    width: 100%;
    height: 44px;
    border: 0;
}

.passkey-offer-frame .webauth-loading-button {
    width: 100%;
}

.passkey-offer-later {
    margin-top: 0.5em;
    color: #999;
}

.passkey-offer-icon path {
    stroke: #555;
    transition: stroke 0.18s ease;
}

.passkey-offer-modal .modal-content:hover .passkey-offer-icon path,
.passkey-offer-modal.passkey-offer-active .passkey-offer-icon path {
    stroke: #ff3b30;
}

.passkey-offer-modal .modal-content:hover .passkey-offer-icon path:nth-child(1),
.passkey-offer-modal.passkey-offer-active .passkey-offer-icon path:nth-child(1) {
    transition-delay: 0s;
}

.passkey-offer-modal .modal-content:hover .passkey-offer-icon path:nth-child(2),
.passkey-offer-modal.passkey-offer-active .passkey-offer-icon path:nth-child(2) {
    transition-delay: 0.07s;
}

.passkey-offer-modal .modal-content:hover .passkey-offer-icon path:nth-child(3),
.passkey-offer-modal.passkey-offer-active .passkey-offer-icon path:nth-child(3) {
    transition-delay: 0.14s;
}

.passkey-offer-modal .modal-content:hover .passkey-offer-icon path:nth-child(4),
.passkey-offer-modal.passkey-offer-active .passkey-offer-icon path:nth-child(4) {
    transition-delay: 0.21s;
}

.passkey-offer-modal .modal-content:hover .passkey-offer-icon path:nth-child(5),
.passkey-offer-modal.passkey-offer-active .passkey-offer-icon path:nth-child(5) {
    transition-delay: 0.28s;
}
