/* AgriDrone auth pages: login / register */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: auto !important;
    min-height: 100%;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    min-height: 100dvh;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background:
        radial-gradient(1200px 420px at 50% -80px, rgba(167, 243, 208, 0.55), transparent 70%),
        linear-gradient(180deg, #ecfdf5 0%, #f8fafc 38%, #f8fafc 100%);
    color: #1e293b;
    color-scheme: light;
    overflow: auto !important;
}

::selection {
    background: #a7f3d0;
}

.auth-shell {
    position: relative;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    min-height: 100dvh;
    width: 100%;
    overflow-x: hidden;
}

.auth-decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.auth-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(16, 185, 129, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 185, 129, 0.07) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: radial-gradient(ellipse at 50% 0%, #000 35%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 35%, transparent 78%);
}

.auth-leaf {
    position: absolute;
    opacity: 0.18;
    color: #34d399;
}

.auth-leaf--tl {
    top: 18px;
    left: 14px;
    width: 42px;
    height: 42px;
    transform: rotate(-18deg);
}

.auth-leaf--tr {
    top: 72px;
    right: 18px;
    width: 34px;
    height: 34px;
    transform: rotate(22deg);
}

.auth-leaf--br {
    bottom: 90px;
    right: -6px;
    width: 64px;
    height: 64px;
    transform: rotate(12deg);
    opacity: 0.12;
}

.auth-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    max-width: 28rem;
    margin: 0 auto;
    padding: 40px 20px calc(24px + env(safe-area-inset-bottom, 0px));
}

.auth-header {
    text-align: center;
    padding: 8px 4px 8px;
}

.auth-logo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 86%;
    margin: 0 auto 20px;
}

.auth-logo__glow {
    position: absolute;
    inset: -18px;
    background: rgba(209, 250, 229, 0.55);
    filter: blur(40px);
    border-radius: 9999px;
    pointer-events: none;
}

.auth-logo__img {
    position: relative;
    z-index: 10;
    display: block;
    height: 64px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 10px 28px rgba(15, 118, 110, 0.08);
}

.ld-bounce-soft {
    animation: ld-bounce-soft 3s ease-in-out infinite;
}

@keyframes ld-bounce-soft {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-7px);
    }
}

.ld-scale-in {
    animation: ld-scale-in 0.55s ease both;
}

@keyframes ld-scale-in {
    from {
        opacity: 0;
        transform: scale(0.97) translateY(10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.auth-title {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 800 !important;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #1e293b;
}

.auth-subtitle {
    margin: 0;
    font-size: 13px;
    font-weight: 500 !important;
    color: rgba(5, 150, 105, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.22em;
}

.auth-body {
    padding: 16px 0 0;
    flex: 1;
}

.auth-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 32px;
    padding: 24px;
    box-shadow: 0 20px 40px -10px rgba(22, 101, 52, 0.15);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    margin: 0;
}

.input-group--phone {
    position: relative;
    z-index: 5;
    overflow: visible;
}

.input-label {
    display: block;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 700 !important;
    color: #059669;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.input-box {
    display: flex;
    align-items: center;
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1.5px solid #d1fae5;
    border-radius: 16px;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-box:focus-within {
    border-color: #059669;
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.12);
}

.input-box__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: #34d399;
    margin-right: 10px;
}

.input-box__icon svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.input-box__icon .lucide-shield-check {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.input-box--phone {
    position: relative;
    overflow: visible;
}

.area-code {
    position: relative;
    flex-shrink: 0;
    margin-right: 8px;
    z-index: 20;
}

.area-code__trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #059669;
    font-size: 15px;
    font-weight: 700 !important;
    line-height: 1;
    white-space: nowrap;
}

.area-code__arrow {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #059669;
    transition: transform 0.2s ease;
}

.area-code.is-open .area-code__arrow {
    transform: rotate(180deg);
}

.area-code__dropdown {
    display: none;
    position: absolute;
    left: 0;
    top: calc(100% + 10px);
    min-width: 220px;
    max-width: min(78vw, 300px);
    max-height: 220px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
    border: 1px solid #d1fae5;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    z-index: 50;
    -webkit-overflow-scrolling: touch;
}

.area-code.is-open .area-code__dropdown {
    display: block;
}

.area-code__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}

.area-code__item:last-child {
    border-bottom: none;
}

.area-code__item:active,
.area-code__item:hover {
    background: #ecfdf5;
}

.area-code__name {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: #334155;
    line-height: 1.35;
    word-break: break-word;
}

.area-code__code {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700 !important;
    color: #059669;
}

.input-box__field {
    flex: 1;
    min-width: 0;
    height: 100% !important;
    border: none !important;
    outline: none !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 15px !important;
    color: #1e293b !important;
    background: transparent !important;
    font-weight: 400 !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
}

.input-box__field::placeholder {
    color: #94a3b8;
}

.toggle-password {
    flex-shrink: 0;
    width: 36px;
    height: 100%;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    margin-right: -6px;
}

.toggle-password svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.toggle-password .icon-eye-off {
    display: none;
}

.toggle-password.show .icon-eye {
    display: none;
}

.toggle-password.show .icon-eye-off {
    display: block;
}

.remember-row {
    display: flex;
    align-items: center;
    margin: -4px 0 0;
    padding-left: 2px;
}

.remember-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0 10px 0 0;
    accent-color: #059669;
    cursor: pointer;
    flex-shrink: 0;
}

.remember-row label {
    font-size: 13px;
    font-weight: 500 !important;
    color: #475569;
    cursor: pointer;
    user-select: none;
}

.auth-submit {
    padding-top: 8px;
}

.auth-shell button {
    font-family: inherit;
}

.auth-btn {
    position: relative;
    overflow: hidden;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    border: none !important;
    background: linear-gradient(to right, #059669, #16a34a);
    color: #fff;
    font-size: 16px;
    font-weight: 700 !important;
    letter-spacing: 0.01em;
    padding: 16px 12px;
    border-radius: 16px;
    box-shadow: 0 15px 30px -10px rgba(22, 101, 52, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
}

.auth-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -55%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
    transform: skewX(-18deg);
    animation: ld-btn-shine 3.2s ease-in-out infinite;
}

.ld-btn-glow {
    animation: ld-btn-glow 2.8s ease-in-out infinite;
}

@keyframes ld-btn-shine {
    0%,
    55% {
        left: -55%;
    }
    100% {
        left: 130%;
    }
}

@keyframes ld-btn-glow {
    0%,
    100% {
        box-shadow: 0 15px 30px -10px rgba(22, 101, 52, 0.5);
    }
    50% {
        box-shadow: 0 18px 36px -8px rgba(22, 101, 52, 0.62);
    }
}

.auth-btn:hover {
    filter: brightness(1.04);
}

.auth-btn:active {
    transform: scale(0.98);
}

.auth-btn:disabled,
.auth-btn.is-disabled {
    opacity: 0.6;
    box-shadow: none;
    animation: none;
}

.forgot-link {
    display: block;
    margin-top: 18px;
    text-align: center;
    font-size: 14px;
    font-weight: 600 !important;
    color: #059669;
    text-decoration: none;
}

.forgot-link:hover {
    text-decoration: underline;
}

.auth-switch {
    text-align: center;
    margin-top: 12px;
    font-size: 14px;
    font-weight: 400 !important;
    color: #64748b;
}

.auth-switch a {
    color: #059669;
    font-weight: 700 !important;
    text-decoration: none;
    margin-left: 4px;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.auth-brand-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 28px;
    opacity: 0.4;
}

.auth-brand-footer span {
    line-height: 1;
}

.auth-brand-footer__icon {
    font-size: 18px;
}

.auth-brand-footer__text {
    font-size: 12px;
    font-weight: 500 !important;
    color: #94a3b8;
}

.captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.captcha-preview {
    flex: 1;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #d1fae5;
    border-radius: 16px;
    background:
        linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
    overflow: hidden;
}

.captcha-code {
    flex: 1;
    min-width: 0;
    height: 48px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800 !important;
    letter-spacing: 0.2em;
    padding-left: 0.2em;
    font-family: "Comic Sans MS", "Segoe Print", "Bradley Hand", cursive;
    background-image: linear-gradient(90deg, #047857 0%, #0369a1 35%, #d97706 70%, #dc2626 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #047857;
    user-select: none;
    line-height: 1;
    filter: saturate(1.25);
}

.captcha-code:active {
    opacity: 0.75;
}

.captcha-refresh {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border: 1.5px solid #d1fae5;
    border-radius: 16px;
    background: #fff;
    color: #059669;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.15s ease;
}

.captcha-refresh svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.captcha-refresh:active {
    transform: rotate(90deg);
    background: #ecfdf5;
}

.reward-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(5, 150, 105, 0.08);
    border: 1px solid rgba(5, 150, 105, 0.22);
    border-radius: 14px;
    padding: 10px 14px;
}

.reward-banner__icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    color: #059669;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reward-banner__icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
}

.reward-banner__text {
    font-size: 13px;
    font-weight: 600 !important;
    color: #065f46;
}

.z-mask {
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.45);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 99999;
    display: none;
}

.notice {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    min-height: 12rem;
    padding: 1.6rem;
    background-color: #fff;
    border: 1px solid #d1fae5;
    border-radius: 20px;
    box-shadow: 0 20px 40px -12px rgba(22, 101, 52, 0.22);
}

.notice-txt {
    width: 100%;
    word-wrap: break-word;
    word-break: normal;
}

.notice-txt p {
    width: 100%;
    line-height: 1.6rem;
    font-size: 14px;
    color: #475569;
    margin-top: 10px;
}

.notice-tit {
    width: 100%;
    text-align: center;
    font-size: 1.15rem;
    margin-bottom: 1rem;
    color: #1e293b;
    font-weight: 700 !important;
}

.notice-btn {
    width: 80%;
    margin: 1.6rem auto 0;
    height: 2.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    font-weight: 700 !important;
    border-radius: 16px;
    background: linear-gradient(to right, #059669, #16a34a);
    box-shadow: 0 10px 22px -8px rgba(22, 101, 52, 0.45);
    cursor: pointer;
}

.copy-toast {
    position: fixed;
    top: 16px;
    left: 50%;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 10px;
    width: calc(100% - 40px);
    max-width: 400px;
    padding: 12px 18px;
    box-sizing: border-box;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #d1fae5;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
    transform: translateX(-50%) translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.copy-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.copy-toast__icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #059669;
    color: #fff;
    font-size: 13px;
    font-weight: 700 !important;
    line-height: 22px;
    text-align: center;
}

.copy-toast__text {
    flex: 1;
    font-size: 15px;
    font-weight: 600 !important;
    color: #1e293b;
    line-height: 1.4;
}

@media (min-height: 860px) {
    .auth-content {
        justify-content: center;
        padding-top: 48px;
    }
}
