* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    height: 100%;
    width: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000000;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
    width: 100%;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    max-width: 1100px;
    width: 100%;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    -webkit-box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

.left-section {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    background: #ffffff;
    padding: 60px 40px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    color: #2d3748;
}

.company-name {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}

.company-tagline {
    font-size: 1.1rem;
    opacity: 0.7;
    margin-bottom: 40px;
    color: #4a5568;
}

.right-section {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    padding: 60px 50px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-title {
    font-size: 2rem;
    color: #2d3748;
    margin-bottom: 10px;
}

.login-subtitle {
    color: #718096;
    font-size: 0.95rem;
}

.notice-box {
    background: #f0fdf4;
    border-left: 4px solid #22c55e;
    padding: 15px;
    margin-bottom: 30px;
    border-radius: 5px;
}

.notice-title {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    color: #15803d;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.notice-title::before {
    content: "⚠";
    font-size: 1.2rem;
    margin-right: 8px;
}

.notice-text {
    color: #166534;
    font-size: 0.9rem;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 0.95rem;
    -webkit-animation: blink-highlight 2s ease-in-out infinite;
    animation: blink-highlight 2s ease-in-out infinite;
}

.input-wrapper {
    position: relative;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    -webkit-transition: border-color 0.3s;
    transition: border-color 0.3s;
}

.input-wrapper:focus-within {
    border-color: #667eea;
}

.input-wrapper.is-invalid {
    border-color: #dc3545;
}

.flag-container {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 0 15px;
    background: #f7fafc;
    border-right: 2px solid #e2e8f0;
    -webkit-box-flex: 0;
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
}

.flag {
    font-size: 1.5rem;
    margin-right: 8px;
}

.country-code {
    font-weight: 600;
    color: #2d3748;
}

.form-input {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    border: none;
    padding: 16px 15px;
    font-size: 1rem;
    outline: none;
    font-family: inherit;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: transparent;
    width: 100%;
    min-width: 0;
}

.form-input::placeholder {
    color: #a0aec0;
}

.helper-text {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #718096;
}

.error-message {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #dc3545;
    display: none;
}

.error-message.show {
    display: block;
}

.submit-btn {
    width: 100%;
    background: #000000;
    color: white;
    border: none;
    padding: 16px;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    -webkit-transition: transform 0.2s, box-shadow 0.2s;
    transition: transform 0.2s, box-shadow 0.2s;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    gap: 10px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
    display: none;
}

.spinner.show {
    display: block;
}

@-webkit-keyframes spin {
    0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}

@keyframes spin {
    0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}

@-webkit-keyframes blink-highlight {
    0%, 100% {
        color: #2d3748;
        text-shadow: none;
        -webkit-transform: scale(1);
        transform: scale(1);
    }
    50% {
        color: #dc2626;
        text-shadow: 0 0 8px rgba(220, 38, 38, 0.5);
        -webkit-transform: scale(1.02);
        transform: scale(1.02);
    }
}

@keyframes blink-highlight {
    0%, 100% {
        color: #2d3748;
        text-shadow: none;
        -webkit-transform: scale(1);
        transform: scale(1);
    }
    50% {
        color: #dc2626;
        text-shadow: 0 0 8px rgba(220, 38, 38, 0.5);
        -webkit-transform: scale(1.02);
        transform: scale(1.02);
    }
}

.otp-info {
    text-align: center;
    margin-top: 20px;
    color: #718096;
    font-size: 0.9rem;
}

.alert-danger {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 12px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.footer-note {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px;
    text-align: center;
    font-size: 0.85rem;
    z-index: 1000;
}

.footer-note a {
    color: #4a9eff;
    text-decoration: none;
}

.footer-note a:hover {
    text-decoration: underline;
}

/* OTP Verification Specific Styles */
.info-box {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 15px;
    margin-bottom: 30px;
    border-radius: 5px;
}

.info-text {
    color: #1e40af;
    font-size: 0.9rem;
    line-height: 1.5;
}

.info-text strong {
    color: #1e3a8a;
    font-weight: 600;
}

.otp-input-wrapper {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
    width: 100%;
}

.otp-input {
    width: 100%;
    max-width: 280px;
    height: 60px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    outline: none;
    -webkit-transition: border-color 0.3s;
    transition: border-color 0.3s;
    font-family: inherit;
    letter-spacing: 0.5em;
    padding: 0 20px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: white;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.otp-input:focus {
    border-color: #667eea;
}

.otp-input.is-invalid {
    border-color: #dc3545;
}

.resend-section {
    text-align: center;
    margin-top: 20px;
}

.resend-timer {
    color: #718096;
    font-size: 0.9rem;
}

.resend-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.resend-link:hover {
    color: #5568d3;
    text-decoration: underline;
}

.resend-link.disabled {
    color: #a0aec0;
    cursor: not-allowed;
    text-decoration: none;
}

.back-link {
    text-align: center;
    margin-top: 20px;
}

.back-link a {
    color: #718096;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.back-link a:hover {
    color: #2d3748;
    text-decoration: underline;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
    padding: 12px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

/* Tablet Styles */
@media (max-width: 1024px) and (min-width: 769px) {
    .container {
        max-width: 900px;
    }

    .left-section {
        padding: 50px 35px;
    }

    .right-section {
        padding: 50px 40px;
    }

    .company-name {
        font-size: 2.2rem;
    }
}

/* Mobile and Tablet Styles */
@media (max-width: 768px) {
    html {
        height: -webkit-fill-available;
        width: 100%;
        overflow-x: hidden;
    }

    body {
        padding: 15px;
        padding-bottom: 100px;
        min-height: 100vh;
        min-height: -webkit-fill-available;
        display: -webkit-box !important;
        display: -ms-flexbox !important;
        display: flex !important;
        -webkit-box-orient: vertical !important;
        -webkit-box-direction: normal !important;
        -ms-flex-direction: column !important;
        flex-direction: column !important;
        -webkit-box-align: stretch !important;
        -ms-flex-align: stretch !important;
        align-items: stretch !important;
        -webkit-box-pack: start !important;
        -ms-flex-pack: start !important;
        justify-content: flex-start !important;
        padding-top: 20px;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .container {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        max-width: 100% !important;
        width: 100% !important;
        border-radius: 15px;
        margin: 0 auto 20px auto !important;
        -webkit-box-flex: 0;
        -ms-flex: 0 0 auto;
        flex: 0 0 auto;
        flex-shrink: 0;
    }

    .left-section {
        padding: 30px 25px 20px 25px;
        text-align: center;
        width: 100% !important;
        -webkit-box-flex: 0;
        -ms-flex: 0 0 auto;
        flex: 0 0 auto;
    }

    .company-name {
        font-size: 1.75rem;
        margin-bottom: 12px;
        line-height: 1.3;
    }

    .company-tagline {
        font-size: 1rem;
        margin-bottom: 0;
        line-height: 1.4;
    }

    .right-section {
        padding: 30px 25px 35px 25px;
        width: 100% !important;
        -webkit-box-flex: 0;
        -ms-flex: 0 0 auto;
        flex: 0 0 auto;
    }

    .login-header {
        margin-bottom: 25px;
    }

    .login-title {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }

    .login-subtitle {
        font-size: 0.9rem;
    }

    .notice-box {
        padding: 12px;
        margin-bottom: 25px;
    }

    .notice-title {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }

    .notice-text {
        font-size: 0.85rem;
    }

    .form-group {
        margin-bottom: 20px;
    }

    .form-label {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }

    .input-wrapper {
        border-radius: 8px;
    }

    .flag-container {
        padding: 0 12px;
    }

    .flag {
        font-size: 1.3rem;
        margin-right: 6px;
    }

    .country-code {
        font-size: 0.95rem;
    }

    .form-input {
        padding: 14px 12px;
        font-size: 0.95rem;
    }

    .helper-text {
        font-size: 0.8rem;
        margin-top: 6px;
    }

    .error-message {
        font-size: 0.8rem;
    }

    .submit-btn {
        padding: 14px;
        font-size: 1rem;
    }

    .otp-info {
        font-size: 0.85rem;
        margin-top: 15px;
    }

    .alert-danger {
        padding: 10px 12px;
        font-size: 0.85rem;
        margin-bottom: 15px;
    }

    .footer-note {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        margin-top: 0;
        padding: 12px 15px;
        font-size: 0.8rem;
        background: rgba(0, 0, 0, 0.9);
        border-radius: 0;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        z-index: 1000;
        -webkit-box-flex: 0;
        -ms-flex: 0 0 auto;
        flex: 0 0 auto;
    }

    .footer-note p {
        margin: 0;
        line-height: 1.5;
    }

    /* OTP Specific Mobile Styles */
    .info-box {
        padding: 12px;
        margin-bottom: 25px;
    }

    .info-text {
        font-size: 0.85rem;
        line-height: 1.4;
    }

    .otp-input-wrapper {
        margin-bottom: 20px;
    }

    .otp-input {
        max-width: 100%;
        height: 55px;
        font-size: 1.3rem;
        letter-spacing: 0.3em;
        padding: 0 15px;
    }

    .resend-section {
        margin-top: 15px;
    }

    .resend-timer {
        font-size: 0.85rem;
    }

    .resend-link {
        font-size: 0.85rem;
    }

    .back-link {
        margin-top: 15px;
    }

    .back-link a {
        font-size: 0.85rem;
    }

    .alert-success {
        padding: 10px 12px;
        font-size: 0.85rem;
        margin-bottom: 15px;
    }
}

/* Small Mobile Styles */
@media (max-width: 480px) {
    body {
        padding: 10px;
        padding-top: 15px;
        padding-bottom: 70px; /* Add bottom padding to account for footer */
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        justify-content: center;
    }
    
    .container {
        margin-top: auto;
        margin-bottom: auto;
        border-radius: 12px;
    }

    .left-section {
        padding: 25px 20px 15px 20px;
    }

    .company-name {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }

    .company-tagline {
        font-size: 0.9rem;
    }

    .right-section {
        padding: 25px 20px 30px 20px;
    }

    .login-header {
        margin-bottom: 20px;
    }

    .login-title {
        font-size: 1.35rem;
    }

    .login-subtitle {
        font-size: 0.85rem;
    }

    .notice-box {
        padding: 10px;
        margin-bottom: 20px;
    }

    .notice-title {
        font-size: 0.85rem;
    }

    .notice-text {
        font-size: 0.8rem;
    }

    .form-label {
        font-size: 0.85rem;
    }

    .flag-container {
        padding: 0 10px;
    }

    .flag {
        font-size: 1.2rem;
        margin-right: 5px;
    }

    .country-code {
        font-size: 0.9rem;
    }

    .form-input {
        padding: 12px 10px;
        font-size: 0.9rem;
    }

    .submit-btn {
        padding: 12px;
        font-size: 0.95rem;
    }

    .otp-input {
        height: 50px;
        font-size: 1.2rem;
        letter-spacing: 0.25em;
        padding: 0 12px;
    }

    .footer-note {
        padding: 10px 12px;
        font-size: 0.75rem;
    }

    .info-text {
        font-size: 0.8rem;
    }
}

/* Large Desktop Styles */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }

    .left-section {
        padding: 70px 50px;
    }

    .right-section {
        padding: 70px 60px;
    }
}

/* Android-specific fixes */
@supports (-webkit-appearance: none) {
    .form-input,
    .otp-input {
        -webkit-appearance: none;
    }
}

/* Fix for Android Chrome address bar */
@media screen and (max-width: 768px) {
    body {
        min-height: 100vh;
        min-height: calc(100vh - env(safe-area-inset-bottom));
    }
}

/* Fix for Android text rendering */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .form-input,
    .otp-input,
    .submit-btn {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Ensure proper width on Android - Force vertical stacking */
@media screen and (max-width: 768px) {
    html, body {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    body {
        display: -webkit-box !important;
        display: -ms-flexbox !important;
        display: flex !important;
        -webkit-box-orient: vertical !important;
        -webkit-box-direction: normal !important;
        -ms-flex-direction: column !important;
        flex-direction: column !important;
        -webkit-box-align: stretch !important;
        -ms-flex-align: stretch !important;
        align-items: stretch !important;
    }
    
    .container {
        width: 100% !important;
        max-width: 100% !important;
        display: -webkit-box !important;
        display: -ms-flexbox !important;
        display: flex !important;
        -webkit-box-orient: vertical !important;
        -webkit-box-direction: normal !important;
        -ms-flex-direction: column !important;
        flex-direction: column !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .left-section,
    .right-section {
        width: 100% !important;
        max-width: 100% !important;
        -webkit-box-flex: 0 !important;
        -ms-flex: 0 0 auto !important;
        flex: 0 0 auto !important;
    }
    
    .footer-note {
        width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
        right: 0 !important;
    }
}
