* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0769FB 0%, #00B3FF 100%);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    padding: 20px;
}

html {
    height: -webkit-fill-available;
}

.container {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    z-index: 10;
    position: relative;
    margin: auto;
}

.container h1 {
    text-align: center;
    color: #0769FB;
    margin-bottom: 30px;
    font-size: clamp(24px, 5vw, 32px);
    font-weight: 700;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-group input {
    width: 100%;
    padding: 16px 15px 16px 50px;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    font-size: clamp(14px, 2.5vw, 15px);
    transition: all 0.3s ease;
    outline: none;
    background: #f8f9fa;
}

.form-group label {
    position: absolute;
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: clamp(12px, 2.2vw, 14px);
    font-weight: 400;
    pointer-events: none;
    transition: all 0.3s ease;
    background: transparent;
    padding: 0 5px;
}

.form-group input:focus {
    border-color: #0769FB;
    background: white;
    box-shadow: 0 0 0 4px rgba(7, 105, 251, 0.1);
}

.form-group input:focus+label,
.form-group input:not(:placeholder-shown)+label {
    top: -12px;
    left: 45px;
    transform: none;
    font-size: clamp(11px, 2vw, 12px);
    font-weight: 600;
    background: white;
    padding: 0 8px;
    color: #0769FB;
}

/* Icon dalam Input */
.form-group::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.5;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.form-group:has(input:focus)::before {
    opacity: 0.8;
}

.form-group.nama::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230769FB' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'%3E%3C/path%3E%3Ccircle cx='12' cy='7' r='4'%3E%3C/circle%3E%3C/svg%3E");
}

.form-group.email::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230769FB' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'%3E%3C/path%3E%3Cpolyline points='22,6 12,13 2,6'%3E%3C/polyline%3E%3C/svg%3E");
}

.form-group.password::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230769FB' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'%3E%3C/path%3E%3C/svg%3E");
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #0769FB 0%, #00B3FF 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: clamp(14px, 2.5vw, 16px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(7, 105, 251, 0.3);
    margin-top: 10px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(7, 105, 251, 0.4);
}

.btn-login:active {
    transform: translateY(-1px);
}

/* Animasi Gelombang Air yang Smooth */
.wave-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 500px;
    z-index: 1;
    overflow: hidden;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: 1000px 100px;
    background-position: 0 bottom;
    background-repeat: repeat-x;
}

.wave.wave1 {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 100' preserveAspectRatio='none'%3E%3Cpath d='M0,50 Q250,0 500,50 T1000,50 L1000,100 L0,100 Z' fill='%23ffffff' fill-opacity='0.3'/%3E%3C/svg%3E");
    animation: wave-animation1 15s linear infinite;
    opacity: 0.4;
    z-index: 3;
}

.wave.wave2 {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 100' preserveAspectRatio='none'%3E%3Cpath d='M0,70 Q250,20 500,70 T1000,70 L1000,100 L0,100 Z' fill='%23ffffff' fill-opacity='0.3'/%3E%3C/svg%3E");
    animation: wave-animation2 20s linear infinite;
    opacity: 0.3;
    z-index: 2;
}

.wave.wave3 {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 100' preserveAspectRatio='none'%3E%3Cpath d='M0,40 Q250,80 500,40 T1000,40 L1000,100 L0,100 Z' fill='%23ffffff' fill-opacity='0.3'/%3E%3C/svg%3E");
    animation: wave-animation3 25s linear infinite;
    opacity: 0.2;
    z-index: 1;
}

@keyframes wave-animation1 {
    0% {
        background-position-x: 0;
    }

    100% {
        background-position-x: 1000px;
    }
}

@keyframes wave-animation2 {
    0% {
        background-position-x: 0;
    }

    100% {
        background-position-x: -1000px;
    }
}

@keyframes wave-animation3 {
    0% {
        background-position-x: 0;
    }

    100% {
        background-position-x: 1000px;
    }
}

/* Alert Error */
.alert-error {
    background: #fee;
    border: 1px solid #fcc;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #c33;
    font-size: clamp(13px, 2.2vw, 14px);
}

/* Responsive untuk Tablet */
@media (max-width: 768px) {
    .container {
        padding: 35px 25px;
        max-width: 90%;
    }

    .wave-container {
        height: 400px;
    }
}

/* Responsive untuk Mobile */
@media (max-width: 480px) {
    body {
        padding: 15px;
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }

    .container {
        padding: 25px 20px;
        border-radius: 15px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    }

    .form-group {
        margin-bottom: 20px;
    }

    .form-group input {
        padding: 14px 12px 14px 45px;
        border-radius: 10px;
        font-size: 16px;
        -webkit-appearance: none;
        appearance: none;
    }

    .form-group::before {
        left: 15px;
        width: 18px;
        height: 18px;
    }

    .form-group label {
        left: 45px;
    }

    .form-group input:focus+label,
    .form-group input:not(:placeholder-shown)+label {
        left: 40px;
    }

    .btn-login {
        padding: 14px;
        border-radius: 10px;
    }

    .wave-container {
        height: 300px;
    }
}

/* Fix khusus untuk iOS Safari */
@supports (-webkit-touch-callout: none) {
    body {
        min-height: 100vh;
        min-height: -webkit-fill-available;
        height: 100%;
    }
    
    html {
        height: -webkit-fill-available;
    }
}

/* Responsive untuk Mobile Kecil */
@media (max-width: 360px) {
    .container {
        padding: 20px 15px;
    }

    .form-group input {
        padding: 12px 10px 12px 40px;
        font-size: 16px;
    }

    .form-group::before {
        left: 12px;
        width: 16px;
        height: 16px;
    }

    .form-group label {
        left: 40px;
    }

    .btn-login {
        padding: 12px;
    }
}

/* Optimasi untuk Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }

    .container {
        padding: 20px;
        margin: 10px auto;
    }

    .container h1 {
        margin-bottom: 15px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .wave-container {
        height: 200px;
    }
}

/* Fix untuk iOS dengan notch */
@media (max-width: 480px) {
    body {
        padding: max(15px, env(safe-area-inset-top)) 
                 max(15px, env(safe-area-inset-right)) 
                 max(15px, env(safe-area-inset-bottom)) 
                 max(15px, env(safe-area-inset-left));
    }
}