* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    background: url('../img/authenticate.jpg') no-repeat center center / cover fixed;
    background-color: #f0f4f8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #2d3748;
    overflow-x: hidden;
    position: relative;
}

.skyeng-auth-deco {
    position: fixed;
    pointer-events: none;
    z-index: 0;
}

.skyeng-auth-line {
    border-radius: 50%;
    background: transparent;
}

.skyeng-auth-line--1 {
    width: 550px;
    height: 550px;
    border: 2px solid rgba(80, 111, 217, 0.12);
    top: -100px;
    right: -150px;
}

.skyeng-auth-line--2 {
    width: 450px;
    height: 450px;
    border: 2px solid rgba(80, 111, 217, 0.1);
    bottom: -120px;
    left: -130px;
}

.skyeng-auth-line--3 {
    width: 320px;
    height: 320px;
    border: 2px solid rgba(0, 183, 74, 0.1);
    top: 25%;
    left: -80px;
}

.skyeng-auth-line--4 {
    width: 240px;
    height: 240px;
    border: 2px solid rgba(80, 111, 217, 0.12);
    bottom: 12%;
    right: -40px;
}

.skyeng-auth-line--5 {
    width: 700px;
    height: 700px;
    border: 1.5px dashed rgba(80, 111, 217, 0.06);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.skyeng-auth-dot {
    border-radius: 50%;
}

.skyeng-auth-dot--1 {
    width: 14px;
    height: 14px;
    background: rgba(80, 111, 217, 0.2);
    top: 12%;
    left: 10%;
}

.skyeng-auth-dot--2 {
    width: 10px;
    height: 10px;
    background: rgba(0, 183, 74, 0.25);
    top: 25%;
    right: 15%;
}

.skyeng-auth-dot--3 {
    width: 12px;
    height: 12px;
    background: rgba(80, 111, 217, 0.18);
    bottom: 20%;
    left: 18%;
}

.skyeng-auth-dot--4 {
    width: 8px;
    height: 8px;
    background: rgba(0, 116, 255, 0.25);
    bottom: 40%;
    right: 8%;
}

.skyeng-auth-dot--5 {
    width: 16px;
    height: 16px;
    background: rgba(48, 77, 112, 0.12);
    top: 65%;
    left: 6%;
}

.skyeng-auth-dot--6 {
    width: 10px;
    height: 10px;
    background: rgba(80, 111, 217, 0.2);
    top: 8%;
    right: 25%;
}

.skyeng-auth-cross {
    width: 22px;
    height: 22px;
}

.skyeng-auth-cross::before,
.skyeng-auth-cross::after {
    content: '';
    position: absolute;
    border-radius: 1px;
}

.skyeng-auth-cross::before {
    width: 100%;
    height: 2px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.skyeng-auth-cross::after {
    width: 2px;
    height: 100%;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
}

.skyeng-auth-cross--1 {
    top: 18%;
    right: 12%;
    transform: rotate(45deg);
}

.skyeng-auth-cross--1::before,
.skyeng-auth-cross--1::after {
    background: rgba(80, 111, 217, 0.18);
}

.skyeng-auth-cross--2 {
    bottom: 28%;
    left: 12%;
    transform: rotate(20deg);
}

.skyeng-auth-cross--2::before,
.skyeng-auth-cross--2::after {
    background: rgba(0, 183, 74, 0.15);
}

.skyeng-auth-wave {
    position: fixed;
    pointer-events: none;
    z-index: 0;
    left: 0;
    right: 0;
    overflow: hidden;
}

.skyeng-auth-wave--top {
    top: 0;
    height: 150px;
}

.skyeng-auth-wave--bottom {
    bottom: 0;
    height: 120px;
}

.skyeng-auth-wave svg {
    width: 100%;
    height: 100%;
}

@media (max-width: 576px) {
    .skyeng-auth-line--1 {
        width: 280px;
        height: 280px;
        top: -80px;
        right: -100px;
    }

    .skyeng-auth-line--2 {
        width: 220px;
        height: 220px;
        bottom: -80px;
        left: -80px;
    }

    .skyeng-auth-line--3 {
        width: 180px;
        height: 180px;
        left: -60px;
    }

    .skyeng-auth-line--4 {
        width: 140px;
        height: 140px;
        right: -30px;
    }

    .skyeng-auth-line--5 {
        width: 350px;
        height: 350px;
    }

    .skyeng-auth-wave--top {
        height: 80px;
    }

    .skyeng-auth-wave--bottom {
        height: 60px;
    }
}

.login-logo {
    margin-bottom: 2rem;
}

.login-logo img {
    height: 40px;
}

.login-container {
    width: 100%;
    max-width: 700px;
    padding: 2.5rem 2rem;
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.login-title {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 2rem;
    color: #1a202c;
}

.profiles-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
    width: 140px;
}

.profile-card:hover {
    transform: scale(1.05);
}

.profile-card:hover .profile-avatar {
    border-color: #506fd9;
}

.profile-avatar {
    width: 110px;
    height: 110px;
    border-radius: 12px;
    object-fit: cover;
    border: 3px solid transparent;
    transition: border-color 0.2s;
    background: #e2e8f0;
}

.profile-name {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #2d3748;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-role {
    font-size: 0.75rem;
    color: #718096;
    margin-top: 0.2rem;
}

.profile-remove {
    position: absolute;
    top: 0;
    right: 2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(220, 53, 69, 0.9);
    color: #fff;
    border: none;
    font-size: 14px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    display: none;
    transition: background 0.2s;
}

.profile-remove:hover {
    background: #dc3545;
}

.profiles-grid.editing .profile-remove {
    display: block;
}

.profiles-grid.editing .profile-card {
    animation: shake 0.4s ease-in-out infinite alternate;
}

@keyframes shake {
    0% {
        transform: rotate(-1deg);
    }

    100% {
        transform: rotate(1deg);
    }
}

.profile-card-add .profile-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px dashed #cbd5e0;
    background: transparent;
}

.profile-card-add .profile-avatar i {
    font-size: 2.5rem;
    color: #a0aec0;
    transition: color 0.2s;
}

.profile-card-add:hover .profile-avatar i {
    color: #506fd9;
}

.profile-card-add:hover .profile-avatar {
    border-color: #506fd9;
}

.back-to-main {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    margin-top: 1.5rem;
    padding: 0 1.25rem;
    height: 36px;
    color: #2d3748;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid #a0aec0;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.7);
    transition: all 0.2s;
}

.back-to-main i {
    font-size: 0.85rem;
    line-height: 1;
}

.back-to-main:hover {
    color: #1a202c;
    border-color: #506fd9;
    background: rgba(255, 255, 255, 0.9);
}

.manage-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 1.5rem;
    padding: 0 1.25rem;
    height: 36px;
    color: #2d3748;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid #a0aec0;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.7);
    transition: all 0.2s;
    text-align: center;
    line-height: 1;
}

.manage-link:hover {
    color: #1a202c;
    border-color: #506fd9;
    background: rgba(255, 255, 255, 0.9);
}

.password-panel {
    display: none;
    text-align: center;
    max-width: 340px;
    margin: 0 auto;
}

.password-panel.active {
    display: block;
}

.password-panel .selected-user-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.password-panel .selected-avatar {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    object-fit: cover;
    border: 3px solid #506fd9;
    background: #e2e8f0;
    flex-shrink: 0;
}

.password-panel .selected-details {
    text-align: left;
    min-width: 0;
}

.password-panel .selected-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 0.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.password-panel .selected-email {
    font-size: 0.85rem;
    color: #718096;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.password-input-wrap {
    position: relative;
    margin-bottom: 1rem;
}

.password-input-wrap input {
    width: 100%;
    padding: 0.75rem 2.8rem 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #2d3748;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.password-input-wrap input:focus {
    border-color: #506fd9;
}

.password-input-wrap input::placeholder {
    color: #a0aec0;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #a0aec0;
    font-size: 1.2rem;
    cursor: pointer;
}

.password-toggle:hover {
    color: #718096;
}

.login-error {
    color: #dc3545;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    display: none;
}

.login-error:not(:empty) {
    display: block;
}

.btn-login {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    background: #506fd9;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-login:hover {
    background: #4060c9;
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-links {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.back-link,
.forgot-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.45rem 1.25rem;
    color: #2d3748;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid #a0aec0;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.7);
    transition: all 0.2s;
}

.back-link:hover,
.forgot-link:hover {
    color: #1a202c;
    border-color: #506fd9;
    background: rgba(255, 255, 255, 0.9);
}

.full-login-panel {
    display: none;
    text-align: center;
    max-width: 380px;
    margin: 0 auto;
}

.full-login-panel.active {
    display: block;
}

.full-login-panel .form-group {
    margin-bottom: 1rem;
    text-align: left;
}

.full-login-panel .form-group label {
    display: block;
    font-size: 0.8rem;
    color: #718096;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.full-login-panel .form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #2d3748;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.full-login-panel .form-group input:focus {
    border-color: #506fd9;
}

.full-login-panel .form-group input::placeholder {
    color: #a0aec0;
}

.remember-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.remember-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #506fd9;
}

.remember-row label {
    font-size: 0.85rem;
    color: #718096;
    cursor: pointer;
}

.landing-link {
    display: block;
    text-align: center;
    margin-top: 2.5rem;
    color: #a0aec0;
    font-size: 0.8rem;
    text-decoration: none;
}

.landing-link a {
    color: #506fd9;
    text-decoration: none;
}

.landing-link a:hover {
    text-decoration: underline;
}

.btn-login .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0 auto;
}

.btn-login.loading .spinner {
    display: inline-block;
}

.btn-login.loading .btn-text {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 576px) {
    .profile-card {
        width: 30%;
        min-width: 0;
    }

    .profile-avatar {
        width: 70px;
        height: 70px;
    }

    .profiles-grid {
        flex-wrap: nowrap;
        gap: 0.5rem;
    }

    .login-title {
        font-size: 1.25rem;
    }

    .login-container {
        margin: 1rem;
        width: calc(100% - 2rem);
        padding: 2rem 1.25rem;
    }
}

.reset-panel {
    display: none;
    text-align: center;
    max-width: 380px;
    margin: 0 auto;
}

.reset-panel.active {
    display: block;
}

.reset-panel .form-group {
    margin-bottom: 1rem;
    text-align: left;
}

.reset-panel .form-group label {
    display: block;
    font-size: 0.8rem;
    color: #718096;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.reset-panel .form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #2d3748;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.reset-panel .form-group input:focus {
    border-color: #506fd9;
}

.reset-panel .form-group input::placeholder {
    color: #a0aec0;
}

.reset-step {
    display: none;
}

.reset-step.active {
    display: block;
}

.login-success {
    color: #0cb785;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    display: none;
}

.login-success:not(:empty) {
    display: block;
}

.recaptcha-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.recaptcha-wrap .g-recaptcha > div {
    margin: 0 auto;
}
