* {
    box-sizing: border-box;
}

:root {
    --blue: #0866ff;
    --text: #172033;
    --muted: #677080;
    --border: #d8dce3;
    --error: #c73445;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #000;
    color: var(--text);
}

body {
    overflow: hidden;
}

button,
input {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

.app-shell {
    position: relative;
    width: 100%;
    min-height: 100svh;
    overflow: hidden;
    background: #000;
}

.security-screen {
    min-height: 100svh;
    /* Increased bottom padding to 80px + safe area inset to ensure full visibility */
    padding: calc(30px + env(safe-area-inset-top)) 28px calc(80px + env(safe-area-inset-bottom));
    background: #fff;
    overflow-y: auto;    
}


.close-button {
    position: absolute;    
    border: 0;    
    left: 12px;
    background: transparent;
    color: #111;
}

.brand-line,
.sheet-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.brand-line {
    margin-top: 48px;
    font-size: 12px;
}

.brand-avatar {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #1877f2;
    color: #fff;
    font-weight: 700;
}

.brand-avatar.small {
    width: 25px;
    height: 25px;
    font-size: 13px;
}

.security-screen h1 {
    margin: 12px 0 8px;
    font-size: clamp(30px, 8vw, 42px)2px);
    line-height: 1.08;
   
}

.intro {
    margin: 0 0 24px;
    font-size: 18px;
    line-height: 1.42;
}

.attempt-card {
    overflow: hidden;
    border: 1px solid #dedfe2;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 2px 7px rgba(0, 0, 0, .05);
}

.attempt-main {
    display: flex;
    gap: 16px;
    padding: 18px;
}

.device-icon {
    flex: 0 0 58px;
    width: 45px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    border: solid 1px #E7E7E7;
    background: white;
    font-size: 29px;
    
}

.device-icon img{
    margin: 0px -20px;
    height: 50px;
}

.attempt-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 16px;
}

.attempt-details strong {
    font-size: 17px;
    line-height: 1.5;
}

.attempt-details span {
    color: #59616d;
    font-size: 13px;
}

.prevented {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid #e4e5e8;
    color: #59616d;
    font-size: 14px;
}

.blocked-icon {
    color: #dc2437;
    font-size: 17px;
}

.warning-copy {
    margin: 36px 0 24px;
}

.warning-copy h2 {
    margin: 0 0 8px;
    font-size: 17px;
}

.warning-copy p {
    margin: 0;
    font-size: 15.5px;
    line-height: 1.45;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 28px;
}

.primary-button,
.secondary-button,
.change-button {
    width: 100%;
    min-height: 50px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
}

.primary-button {
    border: 0;
    background: var(--blue);
    color: #fff;
}

.secondary-button {
    border: 1px solid #d7d9dd;
    background: #fff;
    color: #111;
}

.backdrop {
    position: fixed;
    inset: 0;
    z-index: 10;
    background: rgba(0, 0, 0, .48);
    opacity: 0;
    visibility: hidden;
    transition: opacity .28s ease, visibility .28s ease;
}

.backdrop.visible {
    opacity: 1;
    visibility: visible;
}

.password-sheet,
.otp-sheet {
    position: fixed;
    z-index: 20;
    left: 0;
    right: 0;
    bottom: 0;
    height: min(92dvh, 760px);
    max-height: 92dvh;
    background: #fff;
    border-radius: 30px 30px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, .18);
    transform: translateY(105%);
    transition: transform .28s cubic-bezier(.2, .8, .2, 1);
    will-change: transform;
    contain: layout paint;
    overflow: hidden;
}

.password-sheet.open,
.otp-sheet.open {
    transform: translateY(0);
}

.sheet-handle {
    position: absolute;
    top: 9px;
    left: 50%;
    width: 42px;
    height: 5px;
    border-radius: 10px;
    background: #d7d9dd;
    transform: translateX(-50%);
}

.sheet-header {
    display: flex;
    align-items: center;
    min-height: 68px;
    padding: 20px 22px 10px;
}

.back-button {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #15212d;
    font-size: 43px;
    line-height: 34px;
    font-weight: 300;
}

.sheet-brand {
    margin-left: 4px;
    font-size: 16px;
}

.sheet-scroll {
    height: calc(100% - 68px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Increased bottom padding to 80px + safe area inset */
    padding: 12px 24px calc(72px + env(safe-area-inset-bottom));
    overscroll-behavior: contain;
}


.sheet-scroll h1 {
    margin: 0 0 14px;
    font-size: 29px;
    line-height: 1.12;
    letter-spacing: -1px;
}

.password-rule {
    margin: 0 0 20px;
    font-size: 15.5px;
    line-height: 1.4;
}

.password-field {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 58px;
    margin-bottom: 10px;
    border: 1.5px solid #d4d8de;
    border-radius: 18px;
    background: #fff;
}

.password-field input {
    width: 100%;
    height: 56px;
    padding: 0 50px 0 16px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #1b2530;
    font-size: 16px;
}

.password-field input::placeholder {
    color: #8a939d;
}

.eye-button {
    position: absolute;
    right: 7px;
    width: 38px;
    height: 38px;
    border: 0;
    background: transparent;
    color: #66717c;
}

.field-error {
    display: none;
    margin: -3px 0 10px;
    padding: 0 4px;
    color: var(--error);
    font-size: 15px;
}

.field-error.visible {
    display: block;
}

.forgot-link {
    display: block;
    margin: 14px 0 18px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--blue);
    font-size: 17px;
    font-weight: 600;
}

.change-button {
    display: block;
    border: 0;
    background: var(--blue);
    color: #fff;
    margin-top: 4px;
}

.otp-content {
    padding-top: 24px;
}

.otp-icon {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    margin-bottom: 18px;
    border-radius: 50%;
    background: #e9f3ff;
    color: var(--blue);
    font-size: 23px;
}

.otp-content p {
    color: #5f6873;
    font-size: 15.5px;
    line-height: 1.45;
}

.demo-code {
    margin: 20px 0;
    padding: 14px;
    border-radius: 14px;
    background: #f3f5f7;
    text-align: center;
    letter-spacing: 8px;
    font-size: 25px;
    font-weight: 700;
}

.otp-input {
    width: 100%;
    height: 56px;
    padding: 0 14px;
    border: 1.5px solid #d4d8de;
    border-radius: 17px;
    outline: 0;
    text-align: center;
    letter-spacing: 1px;
    font-size: 16px;
}

.otp-content .change-button {
    margin-top: 18px;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 50;
    max-width: calc(100% - 40px);
    padding: 12px 17px;
    border-radius: 14px;
    background: #17202a;
    color: #fff;
    font-size: 14px;
    transform: translate(-50%, 30px);
    opacity: 0;
    pointer-events: none;
    transition: .25s ease;
}

.toast.show {
    transform: translate(-50%, 0);
    opacity: 1;
}

@media (min-width: 700px) {
    .security-screen {
        max-width: 720px;
        margin: auto;
        padding-left: 48px;
        padding-right: 48px;
    }

    .password-sheet,
    .otp-sheet {
        left: 50%;
        right: auto;
        width: min(720px, 100%);
        transform: translate(-50%, 105%);
    }

    .password-sheet.open,
    .otp-sheet.open {
        transform: translate(-50%, 0);
    }
}

/* Add to style.css */

/* Red border for the invalid input container */
.password-field.error {
    border-color: #d93025; /* Red border */
    background-color: #fff8f8; /* Soft red tint background */
}

/* Red text for the placeholder/input when in error state */
.password-field.error input {
    color: #d93025;
}

/* Style for individual error message below field */
.input-error-message {
    color: #d93025;
    font-size: 14px;
    margin: -4px 0 12px 4px;
    display: none;
}

.input-error-message.visible {
    display: block;
}

/* Presentation-demo refinements: preserve the original layout while adding the requested visual treatment. */
.password-sheet,
.otp-sheet {
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 222, 235, .42), transparent 34%),
        radial-gradient(circle at 82% 24%, rgba(209, 228, 255, .65), transparent 40%),
        linear-gradient(145deg, #fff8fb 0%, #eef5ff 53%, #effcf9 100%);
}
.password-field:focus-within,
.otp-input:focus {
    border-color: #0866ff;
    box-shadow: 0 0 0 3px rgba(8,102,255,.10);
}
.password-field .eye-button { display:grid; place-items:center; }
.password-field.error { border-color:#d93025; background:#fff8f8; }


/* Mobile tuning: keep the original compact visual style and reduce keyboard jank. */
.password-field.error {
    border-color: #d93025 !important;
    background: #fff8f8;
}
.password-field.error input { color: #d93025; }
.password-field:focus-within {
    border-color: #0866ff;
    box-shadow: 0 0 0 2px rgba(8,102,255,.10);
}
.password-field.error:focus-within {
    border-color: #d93025;
    box-shadow: 0 0 0 2px rgba(217,48,37,.08);
}
input, button { -webkit-appearance: none; }
input { touch-action: manipulation; }

@media (max-width: 600px) {
    .security-screen {
        padding-left: 20px;
        padding-right: 20px;
    }
    .security-screen h1 { font-size: 21px; }
    .intro { font-size: 15px; }
    .attempt-main { padding: 15px; gap: 12px; }
    .device-icon { flex-basis: 50px; width: 50px; height: 62px; font-size: 23px; }
    .attempt-details { font-size: 14px; }
    .attempt-details strong { font-size: 13px; }
    .sheet-header { min-height: 58px; padding: 16px 18px 7px; }
    .sheet-scroll { padding-left: 20px; padding-right: 20px; }
    .sheet-scroll h1 { font-size: 27px; }
    .password-rule { font-size: 14px; }
    .password-field { min-height: 56px; border-radius: 15px; }
    .password-field input { height: 54px; font-size: 16px; }
    .forgot-link { font-size: 15px; }
    .primary-button, .secondary-button, .change-button { min-height: 48px; font-size: 15px; }
    .otp-input { height: 54px; }
}

@media (max-height: 680px) and (max-width: 600px) {
    .password-sheet, .otp-sheet { height: 94dvh; max-height: 94dvh; }
    .sheet-scroll { padding-top: 8px; padding-bottom: 55px; }
    .sheet-scroll h1 { margin-bottom: 9px; }
    .password-rule { margin-bottom: 13px; }
    .password-field { margin-bottom: 7px; }
}
.phone-field { margin-top: 10px; }
.phone-field input { padding-right: 48px; }
.phone-field-icon { position:absolute; right:15px; color:#66717c; pointer-events:none; }

/* Submission loader */
.submission-loader {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(255,255,255,.32);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .16s ease, visibility .16s ease;
}
.submission-loader.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.submission-loader-card {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 145px;
    padding: 14px 18px;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 16px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 12px 35px rgba(0,0,0,.16);
    color: #172033;
    font-size: 14px;
    font-weight: 700;
}
.submission-spinner {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border: 3px solid #dbe6f7;
    border-top-color: #0866ff;
    border-radius: 50%;
    animation: submission-spin .7s linear infinite;
}
@keyframes submission-spin { to { transform: rotate(360deg); } }
body.submission-loading .password-sheet,
body.submission-loading .otp-sheet { pointer-events: none; }


.logout-devices-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 2px 0 14px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.logout-devices-checkbox {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.logout-devices-box {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    border: 1.5px solid #5f6873;
    border-radius: 4px;
    background: transparent;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 10px;
    transition: background-color .15s ease, border-color .15s ease;
}

.logout-devices-checkbox:checked + .logout-devices-box {
    border-color: var(--blue);
    background: var(--blue);
}

.logout-devices-checkbox:focus-visible + .logout-devices-box {
    box-shadow: 0 0 0 2px rgba(8, 102, 255, .18);
}

.logout-devices-text {
    color: #26303d;
    font-size: 13px;
    line-height: 1.35;
}

@media (max-width: 600px) {
    .logout-devices-box {
        flex: 0 0 15px;
        width: 15px;
        height: 15px;
        font-size: 9px;
    }

    .logout-devices-text {
        font-size: 12.5px;
    }
}