﻿/* RESET old layout influence */
.ag-page-bg,
.ag-acrylic,
.ag-wrapper,
.accessgate-index-adapt,
.ag-accesscode-only { all: unset; }

/* Global shell background (reusing Index gradient) */
.ag-shell {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(135deg, rgba(0,0,0,0) 0%, #2181EA 100%),
        url("/images/BackgroundPic.jpg") center/cover no-repeat;
    font-family: arial, system-ui, sans-serif;
}

/* Fixed header */
.ag-header {
    position: fixed;
    top: 0;
    left: 0; right: 0;
    height: 72px;
    padding: 0 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 30;
    pointer-events: none;
}

.ag-header__logo {
    pointer-events: auto;
    width: 240px;
    height: 54px;
    min-width: 170px;
    background: url("/images/easy_connect.svg") left center/contain no-repeat;
    cursor: pointer;
    transition: opacity .18s;
}
.ag-header__logo:hover { opacity:.85; }

.ag-header__right {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.ag-header__login {
    width:56px;height:56px;
    border-radius:50%;
    background:rgba(255,255,255,.78);
    backdrop-filter:blur(3px);
    display:flex;align-items:center;justify-content:center;
    box-shadow:0 2px 8px rgba(0,0,0,.28);
    transition:background-color .18s, box-shadow .18s, transform .18s;
    text-decoration:none;
}
.ag-header__login img {
    width:54%;height:54%;filter:drop-shadow(0 1px 2px rgba(0,0,0,.25));
}
.ag-header__login:hover { background:#2181EA; box-shadow:0 4px 18px rgba(0,0,0,.38); }
.ag-header__login:hover img { filter:brightness(0) invert(1); }
.ag-header__login:active { transform:scale(.92); }

/* Center region (keeps panel centered without stretching) */
.ag-center {
    flex:1;
    padding:120px 20px 60px;
    display:flex;
    align-items:center;
    justify-content:center;
}

/* Panel */
.ag-panel {
    max-width:560px;
    width:100%;
    background:rgba(255,255,255,0.45);
    border-left:1px solid rgba(238,238,238,0.72);
    border-top:1px solid rgba(238,238,238,0.72);
    border-radius:14px;
    box-shadow:0 16px 38px rgba(0,0,0,.28);
    backdrop-filter:blur(6px);
    padding:2.75rem 2.75rem 3.2rem;
    text-align:center;
}

.ag-panel__title {
    margin:0 0 1.85rem;
    font-size:2.35rem;
    font-weight:300;
    letter-spacing:.4px;
    color:#222;
}

/* Messages */
.ag-msg {
    margin:0 0 1.25rem;
    font-size:.95rem;
    font-weight:600;
    padding:.75rem 1rem;
    border-radius:8px;
    backdrop-filter:blur(3px);
}
.ag-msg--error {
    background:rgba(220,53,69,.12);
    color:#b30018;
    border:1px solid rgba(220,53,69,.35);
}
.ag-msg--success {
    background:rgba(25,135,84,.14);
    color:#0e6a44;
    border:1px solid rgba(25,135,84,.30);
}

/* Form hint */
.ag-form__hint {
    margin:0 0 1.55rem;
    font-size:.95rem;
    line-height:1.35rem;
    color:#44525c;
}

/* Code input row */
.ag-code {
    display:flex;
    justify-content:center;
    gap:.5rem;
    margin:0 auto 0;
    user-select:none;
}

.ag-code__digit {
    width:72px;
    height:80px;
    background:rgba(255,255,255,.82);
    border:1px solid #c9ced6;
    border-radius:12px;
    font-size:2.1rem;
    font-weight:300;
    text-align:center;
    outline:none;
    padding:0;
    transition:border-color .18s, box-shadow .18s, background-color .18s;
}
.ag-code__digit:focus {
    border-color:#2181EA;
    box-shadow:0 0 0 4px rgba(33,129,234,.25);
    background:#fff;
}
.ag-code__digit.filled { border-color:#16A249; background:#ffffff; }

/* Hidden submit */
.ag-hidden-submit { display:none; }
/* Added subtle shake animation for invalid attempt */
.ag-shake { animation: agshake .42s ease; }
@keyframes agshake {
    0%,100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(2px); }
}

@media (max-width:520px) {
    .ag-panel { padding:2.1rem 1.6rem 2.4rem; }
    .ag-panel__title { font-size:1.9rem; }
    .ag-code__digit { width:56px;height:64px;font-size:1.9rem; }
    .ag-header { padding:.9rem 1rem 0; height:62px; }
    .ag-header__logo { height:48px; }
    .ag-header__login { width:50px;height:50px; }
}

/* Remove legacy classes */
.digit-box,
.digit { all: unset; }