* {
    font-family: 'Poppins', sans-serif;
}

body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    width: 100%;
    box-sizing: border-box;
}

* {
    box-sizing: border-box;
}

/* Prevent zoom on input focus on iOS */
input[type="email"],
input[type="password"],
input[type="text"] {
    font-size: 16px;
}

@media screen and (-webkit-min-device-pixel-ratio: 0) {

    input[type="email"],
    input[type="password"],
    input[type="text"] {
        font-size: 16px !important;
    }
}

/* Main Background */
.main-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: #08383c;
}

/* Wipe Design Background */
.main-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg,
            rgba(8, 56, 60, 0.9) 0%,
            rgba(10, 74, 80, 0.8) 25%,
            rgba(8, 56, 60, 0.7) 50%,
            rgba(10, 74, 80, 0.8) 75%,
            rgba(8, 56, 60, 0.9) 100%);
    z-index: 1;
}

.main-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgdmlld0JveD0iMCAwIDEwMCAxMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxkZWZzPgo8cGF0dGVybiBpZD0iZ3JpZCIgd2lkdGg9IjIwIiBoZWlnaHQ9IjIwIiBwYXR0ZXJuVW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHBhdGggZD0iTSAyMCAwIEwgMCAwIDAgMjAiIGZpbGw9Im5vbmUiIHN0cm9rZT0icmdiYSgyNTUsMjU1LDI1NSwwLjA1KSIgc3Ryb2tlLXdpZHRoPSIxIi8+CjwvcGF0dGVybj4KPC9kZWZzPgo8cmVjdCB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgZmlsbD0idXJsKCNncmlkKSIvPgo8L3N2Zz4K') repeat;
    opacity: 0.1;
    z-index: 2;
}

/* Video Background */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.video-background video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

/* Video overlay for better text readability */
.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 56, 60, 0.4);
    z-index: 1;
}

/* Vision SA Background Image */
.vision-bg-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/assets/images/authentication/vision-sa.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.3;
    z-index: 0.5;
    pointer-events: none;
}

/* Vision SA Supporter */
.vision-supporter {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 5;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.vision-supporter:hover {
    opacity: 1;
}

.vision-supporter img {
    max-width: 200px;
    max-height: 100px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    backdrop-filter: blur(10px);
}

.vision-text {
    position: absolute;
    font-size: 15rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.05);
    user-select: none;
    pointer-events: none;
}

.vision-text.left {
    top: 10%;
    left: 5%;
    transform: rotate(-15deg);
}

.vision-text.right {
    top: 20%;
    right: 5%;
    transform: rotate(15deg);
}

.vision-text.bottom {
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%) rotate(0deg);
    font-size: 8rem;
}

/* City Skyline */
.city-skyline {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.4), transparent);
    z-index: 2;
}

.city-skyline::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgdmlld0JveD0iMCAwIDEwMCAxMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHg9IjAiIHk9IjgwIiB3aWR0aD0iMTAiIGhlaWdodD0iMjAiIGZpbGw9InJnYmEoMjU1LDI1NSwyNTUsMC4xKSIvPgo8cmVjdCB4PSIxNSIgeT0iNzAiIHdpZHRoPSI4IiBoZWlnaHQ9IjMwIiBmaWxsPSJyZ2JhKDI1NSwyNTUsMjU1LDAuMSkiLz4KPHJlY3QgeD0iMjgiIHk9Ijc1IiB3aWR0aD0iMTIiIGhlaWdodD0iMjUiIGZpbGw9InJnYmEoMjU1LDI1NSwyNTUsMC4xKSIvPgo8cmVjdCB4PSI0NSIgeT0iNjUiIHdpZHRoPSIxMCIgaGVpZ2h0PSIzNSIgZmlsbD0icmdiYSgyNTUsMjU1LDI1NSwwLjEpIi8+CjxyZWN0IHg9IjYwIiB5PSI3MCIgd2lkdGg9IjgiIGhlaWdodD0iMzAiIGZpbGw9InJnYmEoMjU1LDI1NSwyNTUsMC4xKSIvPgo8cmVjdCB4PSI3MyIgeT0iNjAiIHdpZHRoPSIxMiIgaGVpZ2h0PSI0MCIgZmlsbD0icmdiYSgyNTUsMjU1LDI1NSwwLjEpIi8+CjxyZWN0IHg9IjkwIiB5PSI3NSIgd2lkdGg9IjEwIiBoZWlnaHQ9IjI1IiBmaWxsPSJyZ2JhKDI1NSwyNTUsMjU1LDAuMSkiLz4KPC9zdmc+') repeat-x;
    opacity: 0.2;
}

/* Main Container */
.auth-page-wrapper {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    width: 100%;
    overflow-x: hidden;
}

/* Single Column Layout */
.login-container {
    width: 100%;
    max-width: 433px;
    margin: 0 auto;
    position: relative;
    z-index: 20;
}

/* Login Card */
.login-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    width: 100%;
    position: relative;
    overflow: hidden;
    z-index: 20;
    padding: 27px;
    margin: 0 auto;
    max-width: 100%;
    box-sizing: border-box;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

/* Logo Section */
.logo-section {
    text-align: center;
    padding: 0 0 20px;
    position: relative;
}

.logo-container {
    display: inline-block;
    position: relative;
    margin-bottom: 13px;
}

.logo-container img {
    width: 4.7rem;
    height: 4.7rem;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    background-color: #fff;
}

.logo-container:hover img {
    transform: scale(1.05);
}

/* Form Styling */
.form-container {
    padding: 0;
}

.form-title {
    color: #ffffff;
    font-size: clamp(18px, 4vw, 28px);
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

.form-subtitle {
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    margin-bottom: 27px;
    font-size: clamp(12px, 2.5vw, 16px);
    line-height: 1.4;
}

/* Input Wrapper */
.input-wrapper {
    position: relative;
    margin-bottom: 17px;
}

.input-wrapper i {
    position: absolute;
    left: clamp(8px, 2vw, 12px);
    top: 67%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: clamp(14px, 3vw, 16px);
    z-index: 3;
    pointer-events: none;
    transition: color 0.3s ease;
    width: clamp(14px, 3vw, 16px);
    height: clamp(14px, 3vw, 16px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-wrapper input {
    width: 100%;
    padding: clamp(8px, 2vw, 14px) clamp(8px, 2vw, 14px) clamp(8px, 2vw, 14px) clamp(25px, 6vw, 40px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #ffffff;
    font-size: clamp(14px, 3vw, 16px);
    transition: all 0.3s ease;
    box-sizing: border-box;
    line-height: 1.5;
}

.input-wrapper input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.input-wrapper input:focus+i,
.input-wrapper.focused i {
    color: rgba(255, 255, 255, 0.9);
}

.input-wrapper.has-value i {
    color: rgba(255, 255, 255, 0.9);
}

.input-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.input-wrapper label {
    color: #ffffff;
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
    font-size: clamp(13px, 2.8vw, 15px);
    line-height: 1.3;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: clamp(6px, 1.5vw, 10px);
    top: 60%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: clamp(14px, 3vw, 16px);
    z-index: 3;
    padding: clamp(6px, 1.5vw, 10px);
    border-radius: 4px;
    width: clamp(32px, 8vw, 44px);
    height: clamp(32px, 8vw, 44px);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: clamp(32px, 8vw, 44px);
    min-height: clamp(32px, 8vw, 44px);
    transition: all 0.3s ease;
}

.submit-btn {
    min-height: 48px;
}

input[type="checkbox"] {
    min-width: 20px;
    min-height: 20px;
}

/* Better touch targets for mobile */
@media (max-width: 768px) {
    .submit-btn {
        min-height: 44px;
    }

    input[type="checkbox"] {
        min-width: 18px;
        min-height: 18px;
    }
}

@media (max-width: 480px) {
    .submit-btn {
        min-height: 40px;
    }

    input[type="checkbox"] {
        min-width: 16px;
        min-height: 16px;
    }
}

.password-toggle:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
}

/* Eye Icon Classes */
.password-toggle i {
    font-size: inherit;
    color: inherit;
}

.fa-eye,
.fa-eye-slash {
    font-size: clamp(14px, 3vw, 16px);
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.3s ease;
    display: inline-block;
    width: clamp(14px, 3vw, 16px);
    height: clamp(14px, 3vw, 16px);
    text-align: center;
    line-height: clamp(14px, 3vw, 16px);
}

/* Password toggle icon states */
.password-toggle .fa-eye:hover,
.password-toggle .fa-eye-slash:hover {
    color: rgba(255, 255, 255, 0.9);
}

/* Remember Me */
.remember-me {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.remember-me input[type="checkbox"] {
    width: 12px;
    height: 12px;
    margin-right: 7px;
    accent-color: #08383c;
}

.remember-me label {
    color: rgba(255, 255, 255, 0.8);
    font-size: clamp(12px, 2.5vw, 14px);
    margin: 0;
    line-height: 1.3;
}

.forgot-password {
    color: #fff;
    text-decoration: none;
    font-size: clamp(12px, 2.5vw, 14px);
    transition: color 0.3s ease;
    line-height: 1.3;
}

.forgot-password:hover {
    color: #08383c;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: clamp(10px, 2.5vw, 14px);
    background: linear-gradient(135deg, #08383c 0%, #08383c 100%);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: clamp(14px, 3vw, 16px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-bottom: 13px;
    line-height: 1.3;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(8, 56, 60, 0.4);
    background: linear-gradient(135deg, #08383c 0%, #08383c 100%);
}

/* Error Messages */
.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    border-radius: 7px;
    padding: clamp(8px, 2vw, 12px);
    margin-bottom: 13px;
    backdrop-filter: blur(10px);
    font-size: clamp(12px, 2.5vw, 14px);
    line-height: 1.4;
}

/* Responsive adjustments for video background */
@media (max-width: 768px) {
    .video-background video {
        min-width: 100%;
        min-height: 100%;
    }

    .vision-bg-image {
        opacity: 0.2;
    }
}

@media (max-width: 480px) {
    .video-background video {
        min-width: 100%;
        min-height: 100%;
    }

    .vision-bg-image {
        opacity: 0.15;
    }
}

@media (max-width: 480px) {
    .vision-supporter {
        bottom: 10px;
        right: 10px;
    }

    .vision-supporter img {
        max-width: 120px;
        max-height: 60px;
        padding: 6px;
    }

    .top-logo {
        top: 10px;
        left: 10px;
        padding: 10px;
    }

    .top-logo img {
        width: 40px;
        height: 40px;
    }

    .top-logo .logo-text {
        font-size: 10px;
        margin-top: 4px;
    }
}

/* Ultra-wide screens */
@media (min-width: 1920px) {
    .login-container {
        max-width: 467px;
    }

    .login-card {
        padding: 33px;
    }

    .logo-container img {
        width: 8rem;
        height: 8rem;
    }
}

/* Large Tablets and Small Desktops */
@media (max-width: 1200px) {
    .login-container {
        max-width: 400px;
    }
}

@media (max-width: 992px) {
    .auth-page-wrapper {
        padding: 15px;
    }

    .login-container {
        max-width: 367px;
    }

    .login-card {
        padding: 20px;
        border-radius: 20px;
    }

    .logo-container img {
        width: 6rem;
        height: 6rem;
    }
}

@media (max-width: 768px) {
    .auth-page-wrapper {
        padding: 15px;
        align-items: center;
        justify-content: center;
    }

    .login-container {
        max-width: 100%;
        margin: 0 auto;
        width: 100%;
    }

    .login-card {
        margin: 0 auto;
        padding: 17px;
        border-radius: 20px;
        width: 100%;
        max-width: 100%;
    }

    .logo-container img {
        width: 5rem;
        height: 5rem;
    }

    .remember-me {
        margin-bottom: 25px;
    }
}

@media (max-width: 576px) {
    .auth-page-wrapper {
        padding: 10px;
        align-items: center;
        justify-content: center;
    }

    .login-container {
        max-width: 100%;
        margin: 0 auto;
        width: 100%;
    }

    .login-card {
        padding: 13px;
        border-radius: 16px;
        margin: 0 auto;
        width: 100%;
        max-width: 100%;
    }

    .logo-container {
        margin-bottom: 10px;
    }

    .logo-container img {
        width: 2.7rem;
        height: 2.7rem;
    }

    .input-wrapper {
        margin-bottom: 13px;
    }

    .remember-me {
        margin-bottom: 13px;
        flex-direction: column;
        align-items: flex-start;
        gap: 7px;
    }

    .remember-me>div {
        display: flex;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .auth-page-wrapper {
        padding: 5px;
        align-items: center;
        justify-content: center;
    }

    .login-container {
        max-width: 100%;
        margin: 0 auto;
        width: 100%;
    }

    .login-card {
        padding: 10px;
        border-radius: 12px;
        margin: 0 auto;
        width: 100%;
        max-width: 100%;
    }

    .logo-container img {
        width: 2.3rem;
        height: 2.3rem;
    }

    .remember-me {
        margin-bottom: 10px;
    }
}

/* Landscape orientation adjustments */
@media (max-height: 600px) and (orientation: landscape) {
    .auth-page-wrapper {
        padding: 10px;
        align-items: center;
        justify-content: center;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .login-container {
        max-width: 100%;
        margin: 0 auto;
        width: 100%;
    }

    .login-card {
        padding: 13px;
        margin: 0 auto;
        width: 100%;
        max-width: 100%;
    }

    .logo-container {
        margin-bottom: 7px;
    }

    .logo-container img {
        width: 2rem;
        height: 2rem;
    }

    .input-wrapper {
        margin-bottom: 10px;
    }

    .remember-me {
        margin-bottom: 10px;
    }
}

/* Very tall screens */
@media (min-height: 1000px) {
    .auth-page-wrapper {
        padding: 40px;
    }

    .login-card {
        padding: 33px;
    }

    .logo-container img {
        width: 8rem;
        height: 8rem;
    }
}

/* Loading Animation */
.loading {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Success Animation */
@keyframes successPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.success-animation {
    animation: successPulse 0.6s ease-in-out;
}
