/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
    background: #f5f5f7;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Card ── */
.login-card {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
    padding: 48px 40px 36px;
    margin: 24px;
}

/* ── Logo ── */
.login-logo {
    text-align: center;
    margin-bottom: 32px;
}
.login-logo img {
    height: 44px;
    width: auto;
}

/* ── Title ── */
.login-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    text-align: center;
    margin: 0 0 4px 0;
}
.login-subtitle {
    font-size: 14px;
    color: #888;
    text-align: center;
    margin: 0 0 32px 0;
}

/* ── Form Fields ── */
.login-field {
    margin-bottom: 20px;
}
.login-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}
.login-card .form-control {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    background: #ffffff;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    color: #1a1a1a;
    font-size: 15px;
    font-family: inherit;
    box-shadow: none;
    margin-bottom: 0;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.login-card .form-control::placeholder {
    color: #b0b0b0;
}
.login-card .form-control:focus {
    border-color: #ff8f78;
    box-shadow: 0 0 0 3px rgba(255, 143, 120, 0.12);
    outline: none;
}

/* ── Password field wrapper ── */
.login-password-wrap {
    position: relative;
}
.login-password-wrap .form-control {
    padding-right: 48px;
}
.gpassword-show {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    opacity: 0.5;
    transition: opacity 0.2s;
}
.gpassword-show:hover {
    opacity: 0.8;
}
.gpassword-show img {
    width: 22px;
    height: auto;
}

/* ── GiffyShield ── */
.gshield-row {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1.5px solid #e0e0e0;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 24px;
    background: #fafafa;
    height: 54px;
    transition: border-color 0.2s;
}
.gshield-row:hover {
    border-color: #ccc;
}
.gshield-status {
    font-size: 13px;
    color: #888;
    margin-left: auto;
}
.gshield-status.gshield-ok,
.gshield-ok {
    color: #16a34a;
}
.gshield-row input[type="checkbox"] {
    padding: 0;
    height: initial;
    width: initial;
    margin-bottom: 0;
    display: none;
    cursor: pointer;
}
.gshield-row label {
    position: relative;
    cursor: pointer;
    font-weight: 400;
    font-size: 14px;
    color: #444;
}
.gshield-row label:before {
    content: '';
    -webkit-appearance: none;
    background-color: #fff;
    border: 2px solid #ccc;
    padding: 9px;
    display: inline-block;
    position: relative;
    vertical-align: middle;
    cursor: pointer;
    margin-right: 10px;
    border-radius: 4px;
    transition: border-color 0.2s;
}
.gshield-row label:hover:before {
    border-color: #999;
}
.gshield-row input:checked + label:before {
    border: 2px solid #16a34a;
    background: #16a34a;
}
.gshield-row input:checked + label:after {
    content: '';
    display: block;
    position: absolute;
    top: 1px;
    left: 7px;
    width: 6px;
    height: 14px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ── Submit Button ── */
.login-submit-wrap {
    margin-bottom: 16px;
}
.login-card .button-submit {
    width: 100%;
    height: 48px;
    background: #ff8f78;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(255, 143, 120, 0.25);
}
.login-card .button-submit:hover:not(:disabled) {
    background: #f07060;
    box-shadow: 0 4px 16px rgba(255, 143, 120, 0.35);
    transform: translateY(-1px);
}
.login-card .button-submit:active:not(:disabled) {
    transform: translateY(0);
}
.login-card .button-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
#loginBtn:focus {
    outline: none;
    background: #f07060;
}

/* ── OTP Button ── */
.login-card .button-otp {
    width: 100%;
    height: 48px;
    background: #fff;
    color: #ff8f78;
    border: 2px solid #ff8f78;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 16px;
    transition: background 0.2s;
}
.login-card .button-otp:hover {
    background: #fff5f3;
}

/* ── Error ── */
.login-error {
    text-align: center;
    margin-bottom: 8px;
    min-height: 20px;
}
.login-error font {
    font-size: 13px;
}

/* ── Footer ── */
.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}
.login-footer .registerdIp {
    font-size: 12px;
    color: #bbb;
    margin-bottom: 16px;
}
.login-footer .developer img {
    height: 28px;
    width: auto;
    opacity: 0.6;
    transition: opacity 0.2s;
    margin-bottom: 12px;
}
.login-footer .developer img:hover {
    opacity: 0.9;
}
.login-footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
}
.login-footer-links a {
    color: #999;
    text-decoration: none;
    font-size: 12px;
    transition: color 0.2s;
}
.login-footer-links a:hover {
    color: #555;
}
.copyright {
    font-size: 11px;
    color: #bbb;
    margin-top: 4px;
}

/* ── OTP Popup Overlay ── */
#popupOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.popup {
    background: #fff;
    border-radius: 14px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    position: relative;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    text-align: center;
}
.popup h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 20px;
}
.popup .close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}
.popup .close-btn:hover {
    color: #333;
}
.popup .submit-btn {
    width: 100%;
    height: 44px;
    background: #ff8f78;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: background 0.2s;
}
.popup .submit-btn:hover {
    background: #f07060;
}

/* OTP input boxes */
.otp-container-email,
.otp-container-phone {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 16px;
}
.otp-container-email input,
.otp-container-phone input {
    width: 44px;
    height: 48px;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    outline: none;
    transition: border-color 0.2s;
}
.otp-container-email input:focus,
.otp-container-phone input:focus {
    border-color: #ff8f78;
    background: #fff;
}

/* ── Sign-up form (preserved) ── */
.signup-form-wrapper {
    background: #fff;
    padding: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    margin-top: 10px;
    border-radius: 12px;
}
.giffy-signup {
    margin: 0 auto;
    padding: 20px 180px;
    box-sizing: content-box;
    min-height: 100vh;
}
.signup-form label {
    font-size: 16px;
    transition: all .5s ease .1s;
    z-index: 7;
    color: #000;
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}
.signup-form .form-control {
    margin-bottom: 15px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    height: 45px;
    background: #fafafa;
}
.signup-form .btn {
    width: 100%;
    height: 45px;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 500;
    font-size: 16px;
    text-transform: capitalize;
}
.generate-password {
    background: #79c0fb;
}
.password-div {
    position: relative;
}
#toserrorMsg { display: none; color: red; }
#nameerrorMsg { display: none; color: red; }
#emailerrorMsg { display: none; color: red; }
#passworderrorMsg { display: none; color: red; }

/* ── Responsive ── */
@media (max-width: 480px) {
    .login-card {
        margin: 16px;
        padding: 36px 24px 28px;
        border-radius: 14px;
    }
    .login-logo img {
        height: 36px;
    }
    .login-title {
        font-size: 22px;
    }
    .giffy-signup {
        padding: 20px;
    }
}
