/* ===== 기본 리셋 ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== 기본 설정 ===== */
:root {
    --green-dark:   #1b4332;
    --green-main:   #2d6a4f;
    --green-mid:    #40916c;
    --green-light:  #74c69d;
    --green-pale:   #d8f3dc;
    --green-bg:     #f0f7f2;
    --text-dark:    #1a2e22;
    --text-mid:     #4a6358;
    --text-light:   #8aab97;
    --white:        #ffffff;
    --shadow-sm:    0 2px 8px rgba(27, 67, 50, 0.08);
    --shadow-md:    0 8px 32px rgba(27, 67, 50, 0.16);
    --shadow-lg:    0 20px 60px rgba(27, 67, 50, 0.25);
    --radius-sm:    10px;
    --radius-md:    16px;
    --radius-lg:    24px;
    --transition:   0.25s ease;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Noto Sans KR', 'Segoe UI', sans-serif;
    background: linear-gradient(150deg, #1b4332 0%, #2d6a4f 40%, #40916c 100%);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* ===== 배경 장식 잎 ===== */
.bg-decoration {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.leaf {
    position: absolute;
    opacity: 0.07;
}

.leaf img {
    width: 100%;
    height: 100%;
    display: block;
}

.leaf-1 {
    width: 320px;
    height: 320px;
    top: -80px;
    right: -60px;
    transform: rotate(25deg);
    animation: floatLeaf 8s ease-in-out infinite;
}

.leaf-2 {
    width: 200px;
    height: 200px;
    bottom: -40px;
    left: -60px;
    transform: rotate(-30deg);
    animation: floatLeaf 10s ease-in-out infinite reverse;
}

.leaf-3 {
    width: 150px;
    height: 150px;
    bottom: 20%;
    right: -30px;
    transform: rotate(15deg);
    animation: floatLeaf 12s ease-in-out infinite;
}

@keyframes floatLeaf {
    0%, 100% { transform: translateY(0) rotate(var(--r, 25deg)); }
    50%       { transform: translateY(-15px) rotate(var(--r, 25deg)); }
}

/* ===== 레이아웃 ===== */
.login-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 20px 16px;
    position: relative;
    z-index: 1;
}

.login-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    width: 100%;
}

/* ===== 헤더 ===== */
.login-header {
    background: linear-gradient(145deg, var(--green-dark) 0%, var(--green-main) 60%, var(--green-mid) 100%);
    padding: 44px 32px 36px;
    text-align: center;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.login-header::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(116, 198, 157, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.login-header::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
    pointer-events: none;
}

.logo-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 16px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    position: relative;
    z-index: 1;
}

.logo-icon img {
    width: 40px;
    height: 40px;
}

.login-header h1 {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.login-header p {
    font-size: 13px;
    font-weight: 400;
    opacity: 0.8;
    letter-spacing: 0.02em;
    position: relative;
    z-index: 1;
}

/* ===== 바디 ===== */
.login-body {
    padding: 36px 32px 28px;
}

/* ===== 알림 ===== */
.alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

.alert img {
    flex-shrink: 0;
}

.alert-error {
    background-color: #fff2f2;
    color: #c0392b;
    border: 1px solid #fcc;
}

.alert-success {
    background-color: #f0faf3;
    color: var(--green-main);
    border: 1px solid var(--green-pale);
}

/* ===== 폼 그룹 ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-mid);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

/* ===== 인풋 ===== */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    display: flex;
    align-items: center;
    pointer-events: none;
}

.form-group input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 1.5px solid #e2ede6;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    color: var(--text-dark);
    background: var(--green-bg);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    -webkit-appearance: none;
    appearance: none;
    /* 모바일 최소 터치 영역 */
    min-height: 52px;
}

.form-group input:focus {
    border-color: var(--green-mid);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(64, 145, 108, 0.12);
}

.form-group input::placeholder {
    color: var(--text-light);
    font-size: 14px;
}

/* 비밀번호 입력에 오른쪽 패딩 추가 */
#password {
    padding-right: 50px;
}

/* ===== 비밀번호 토글 버튼 ===== */
.btn_eye {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 6px;
    transition: background var(--transition);
    /* 모바일 터치 영역 확보 */
    min-width: 36px;
    min-height: 36px;
}

.btn_eye:hover,
.btn_eye:focus {
    background: var(--green-pale);
    outline: none;
}

/* ===== 로그인 버튼 ===== */
.btn-login {
    width: 100%;
    min-height: 52px;
    margin-top: 8px;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--green-main) 0%, var(--green-mid) 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.04em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-main) 100%);
    opacity: 0;
    transition: opacity var(--transition);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(45, 106, 79, 0.4);
}

.btn-login:hover::before {
    opacity: 1;
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-login span,
.btn-login img {
    position: relative;
    z-index: 1;
}

/* ===== 푸터 ===== */
.login-footer {
    padding: 16px 32px;
    background: var(--green-bg);
    border-top: 1px solid #e8f2eb;
    text-align: center;
}

.login-footer p {
    font-size: 12px;
    color: var(--text-light);
    letter-spacing: 0.02em;
}

/* ===== 모바일 반응형 ===== */
@media (max-width: 480px) {
    body {
        align-items: flex-start;
        padding-top: env(safe-area-inset-top, 0);
    }

    .login-wrapper {
        padding: 0;
        max-width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .login-container {
        border-radius: 0;
        min-height: 100vh;
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
    }

    .login-header {
        padding: 52px 24px 32px;
        padding-top: max(52px, calc(env(safe-area-inset-top) + 32px));
    }

    .logo-icon {
        width: 60px;
        height: 60px;
    }

    .logo-icon img {
        width: 34px;
        height: 34px;
    }

    .login-header h1 {
        font-size: 26px;
    }

    .login-body {
        padding: 32px 24px 24px;
        flex: 1;
    }

    .form-group input {
        font-size: 16px; /* iOS 자동 줌 방지 */
    }

    .btn-login {
        font-size: 17px;
    }

    .login-footer {
        padding: 16px 24px;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
}

/* ===== 소형 모바일 (iPhone SE 등) ===== */
@media (max-width: 360px) {
    .login-header {
        padding: 40px 20px 28px;
    }

    .login-body {
        padding: 28px 20px 20px;
    }

    .login-footer {
        padding: 14px 20px;
    }
}

/* ===== 태블릿 ===== */
@media (min-width: 768px) {
    .login-wrapper {
        padding: 40px 20px;
    }
}

/* ===== 접근성: 키보드 포커스 ===== */
@media (hover: none) {
    .btn-login:hover {
        transform: none;
        box-shadow: none;
    }
}

.btn-login:focus-visible,
.btn_eye:focus-visible,
.form-group input:focus-visible {
    outline: 3px solid var(--green-light);
    outline-offset: 2px;
}
