/* Professional styling for merchant login */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    min-height: 100vh;
}

/* Card styling */
.card {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    background: rgba(30, 41, 59, 0.95); /* Darker card background */
    color: #e2e8f0; /* Light text color for card content */
}

.card-body {
    padding: 1rem !important; /* Further reduced */
}

/* Message styling */
.text-success {
    color: #16a34a;
    font-weight: 500;
    background: rgba(34, 197, 94, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    border-left: 3px solid #16a34a;
    margin: 0.25rem 0;
    font-size: 13px;
}

.text-error {
    color: #dc2626;
    font-weight: 500;
    background: rgba(239, 68, 68, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    border-left: 3px solid #dc2626;
    margin: 0.25rem 0;
    font-size: 13px;
}

.text-info {
    color: #2563eb;
    font-weight: 500;
    background: rgba(59, 130, 246, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    border-left: 3px solid #2563eb;
    margin: 0.25rem 0;
    font-size: 13px;
}

/* Input styling */
.input {
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    background-color: #1a202c; /* Very dark grey background */
    color: #e2e8f0; /* Light text color */
    margin: 0.125rem 0;
}

.input::placeholder {
    color: rgba(226, 232, 240, 0.6); /* Lighter placeholder text */
}

.input:focus {
    border-color: #60a5fa; /* Blue focus border */
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
    outline: none;
}

.input:disabled {
    background-color: #2d3748;
    color: #a0aec0;
    cursor: not-allowed;
}

/* Button styling */
.btn {
    border-radius: 6px;
    padding: 6px 16px;
    font-weight: 600;
    text-transform: none;
    transition: all 0.3s ease;
    margin: 0.125rem 0;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* OTP input styling */
#otpInput {
    text-align: center;
    font-size: 1.25rem;
    letter-spacing: 0.2em;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

/* Loading spinner */
.loading.hidden {
    display: none;
}

.loading-spinner {
    width: 16px;
    height: 16px;
}

/* Resend button styling */
#resendBtn {
    color: #3b82f6;
    font-weight: 500;
    transition: all 0.2s ease;
    margin: 0.125rem 0;
    padding: 0.25rem 0.5rem;
}

#resendBtn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#resendBtn:not(:disabled):hover {
    background-color: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
}

/* Divider styling */
.divider {
    color: #a0aec0;
    font-weight: 500;
}

/* Label styling */
.label-text {
    font-weight: 600;
    color: #e2e8f0;
}

.label-text-alt {
    color: #a0aec0;
    font-size: 0.875rem;
}

/* Card title */
.card-title {
    color: #f7fafc;
    font-weight: 700;
}

/* Responsive design for all devices */

/* Large screens (desktop) */
@media (min-width: 1024px) {
    .container {
        max-width: 28rem; /* 448px */
        padding: 2rem;
    }
}

/* Medium screens (tablets) */
@media (max-width: 768px) {
    .container {
        max-width: 24rem; /* 384px */
        padding: 1.5rem 1rem;
    }
    
    .card-body {
        padding: 1.25rem !important;
    }
    
    .card-title {
        font-size: 1.125rem; /* text-lg */
    }
}

/* Small screens (mobile) */
@media (max-width: 480px) {
    .container {
        max-width: 100%;
        padding: 1rem 0.5rem;
        margin: 0 auto;
    }
    
    .card-body {
        padding: 1rem !important;
    }
    
    .card-title {
        font-size: 1rem; /* text-base */
        margin-bottom: 0.75rem;
    }
    
    .input {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 10px 12px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .label-text {
        font-size: 0.875rem; /* text-sm */
    }
    
    .label-text-alt {
        font-size: 0.75rem; /* text-xs */
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .container {
        padding: 0.75rem 0.25rem;
    }
    
    .card-body {
        padding: 0.75rem !important;
    }
    
    .card-title {
        font-size: 0.875rem; /* text-sm */
    }
    
    .input {
        padding: 8px 10px;
        font-size: 16px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .generatedOtpSection {
        padding: 0.5rem !important;
    }
    
    .generatedOtpSection p {
        font-size: 0.875rem !important;
    }
}

/* Animation for smooth transitions */
.input, .btn, .card {
    transition: all 0.3s ease-in-out;
}

/* Focus states for accessibility */
.btn:focus, .input:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Success animation */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.btn-success:not(:disabled) {
    animation: successPulse 0.3s ease-in-out;
}

/* Registration Form Styling */
#registrationCard {
    margin-top: 1rem;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    backdrop-filter: none !important;
}

#registrationCard .card-body {
    border: none !important;
    background: transparent !important;
}

/* Login card wrapper removal (match Create Account no-panel look) */
#loginCard {
    margin-top: 2.5rem;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    backdrop-filter: none !important;
}

#loginCard .card-body {
    border: none !important;
    background: transparent !important;
}

/* Textarea styling */
.textarea {
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    background-color: #1a202c;
    color: #e2e8f0;
    margin: 0.125rem 0;
    resize: vertical;
    min-height: 50px;
}

.textarea::placeholder {
    color: rgba(226, 232, 240, 0.6);
}

.textarea:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
    outline: none;
}

/* Back button styling */
#backToLoginBtn {
    color: #a0aec0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    padding: 6px 12px;
    font-size: 12px;
}

#backToLoginBtn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Create Account link styling */
#showRegisterBtn {
    background: none;
    border: none;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

#showRegisterBtn:hover {
    color: #1d4ed8;
    text-decoration-thickness: 2px;
}

/* Registration form specific styling */
#registrationForm .form-control {
    margin-bottom: 0.25rem;
}

#registrationForm .label {
    margin-bottom: 0.125rem;
}

/* Slightly compact field sizing for Create Merchant form */
#registrationForm .input,
#registrationForm .select {
    min-height: 2.8rem;
    height: 2.8rem;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}

#registrationForm .textarea {
    min-height: 5.6rem;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

/* Slightly compact field/button sizing for Login form */
#mobileInput,
#otpInput,
#loginMobileCountrySearch {
    min-height: 2.6rem;
    height: 2.6rem;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

#sendOtpBtn,
#verifyBtn {
    min-height: 2.6rem;
    height: 2.6rem;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    font-size: 1rem;
}

/* Form validation styling
   Keep neutral borders by default; JS-controlled error messages/classes handle invalid state. */
#registrationForm .input:invalid,
#registrationForm .textarea:invalid,
#registrationForm .select:invalid,
#registrationForm .input:valid,
#registrationForm .textarea:valid,
#registrationForm .select:valid {
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: none !important;
}

/* Responsive adjustments for registration form */
@media (max-width: 480px) {
    #registrationCard .card-body {
        padding: 0.75rem !important;
    }
    
    .textarea {
        font-size: 16px;
        padding: 6px 12px;
        min-height: 45px;
    }
    
    #backToLoginBtn {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .input {
        padding: 8px 12px;
        font-size: 16px;
    }
}

@media (max-width: 360px) {
    #registrationCard .card-body {
        padding: 0.5rem !important;
    }
    
    .textarea {
        padding: 6px 10px;
        font-size: 16px;
        min-height: 40px;
    }
    
    .input {
        padding: 6px 10px;
        font-size: 16px;
    }
}

/* Smooth transitions for form switching */
.card {
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.card[style*="display: none"] {
    opacity: 0;
    transform: translateY(20px);
}

.card:not([style*="display: none"]) {
    opacity: 1;
    transform: translateY(0);
}