/* Custom CSS for Login Form */

/* Prevent unnecessary scrolling */
html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    padding: 0;
}

/* Authentication container */
.authentication {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
    overflow: hidden;
}

.authentication .container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 15px;
}

.authentication .content-center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
}

.authentication .row {
    width: 100%;
    margin: 0;
    align-items: center;
}

/* Company detail section */
.company_detail {
    text-align: center;
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.company_detail .logo {
    margin-bottom: 15px;
    color: #333;
    font-weight: 700;
}

.company_detail .logo img {
    height: 40px;
    margin-right: 10px;
    vertical-align: middle;
}

.company_detail h3 {
    color: #555;
    margin-bottom: 10px;
    font-weight: 600;
}

.company_detail p {
    color: #777;
    font-size: 16px;
    margin-bottom: 20px;
}

/* Card styling */
.card-plain {
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 30px;
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.card-plain .header h5 {
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

/* Security notice */
.security-notice {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 20px;
    font-size: 12px;
    color: #6c757d;
    text-align: center;
}

.security-notice i {
    color: #28a745;
    margin-right: 5px;
}

/* Input group enhancements */
.input-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.input-group .form-control {
    border-radius: 4px;
    border: 1px solid #ced4da;
    transition: all 0.2s ease-in-out;
    height: 45px;
}

.input-group .form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
}

.input-group-append .input-group-text {
    border-radius: 0 4px 4px 0;
    background-color: #f8f9fa;
    border-color: #ced4da;
    color: #6c757d;
    height: 45px;
}

.input-group-prepend .input-group-text {
    border-radius: 4px 0 0 4px;
    background-color: #f8f9fa;
    border-color: #ced4da;
    color: #6c757d;
    height: 45px;
}

/* Button styling */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    height: 45px;
    border-radius: 25px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-primary:disabled {
    background: #6c757d;
    transform: none;
    box-shadow: none;
}

/* Loading state */
.btn-loading {
    display: none;
}

.btn-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Link styling */
.link {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
    display: block;
    text-align: center;
    margin: 5px 0;
}

.link:hover {
    color: #5a6fd8;
    text-decoration: underline;
}

/* Footer styling */
.footer {
    margin-top: 20px;
}

/* Button disabled state */
.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Theme-specific adjustments */
.theme-black .card-plain {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.theme-black .company_detail {
    color: #fff;
}

.theme-black .company_detail h3,
.theme-black .company_detail h4 {
    color: #fff;
}

.theme-black .company_detail p {
    color: rgba(255, 255, 255, 0.8);
}

/* Animation for form appearance */
.card-plain {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus improvements */
.form-control:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
}

/* Placeholder styling */
.form-control::placeholder {
    color: #6c757d;
    opacity: 0.7;
}

.form-control:focus::placeholder {
    opacity: 0.5;
}

/* Error state improvements */
.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15);
}

.form-control.is-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.15);
}

/* Success and error icons */
.form-control.is-valid {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23dc3545' viewBox='-2 -2 7 7'%3e%3cpath stroke='%23dc3545' d='M0 0l3 3m0-3L0 3'/%3e%3ccircle r='.5'/%3e%3ccircle cx='3' r='.5'/%3e%3ccircle cy='3' r='.5'/%3e%3ccircle cx='3' cy='3' r='.5'/%3e%3c/svg%3E");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Smooth transitions */
.form-control,
.btn,
.link {
    transition: all 0.2s ease-in-out;
}

/* Loading button state */
.btn:disabled .btn-text {
    display: none;
}

.btn:disabled .btn-loading {
    display: inline-block;
}

/* Mobile responsive adjustments */
@media (max-width: 767px) {
    .authentication {
        padding: 0;
        min-height: 100vh;
        align-items: flex-start;
        justify-content: flex-start;
    }
    
    .authentication .content-center {
        min-height: auto;
        align-items: flex-start;
        justify-content: flex-start;
        padding-top: 5px;
    }
    
    .authentication .row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .authentication .col-lg-6 {
        order: 1;
        margin-bottom: 10px;
        flex: 0 0 auto;
    }
    
    .authentication .col-lg-5 {
        order: 2;
        margin-left: 0;
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .company_detail {
        padding: 8px;
        margin-bottom: 0;
        height: auto;
    }
    
    .company_detail h4.logo {
        font-size: 1.5rem;
        margin-bottom: 6px;
    }
    
    .company_detail h3 {
        font-size: 1.2rem;
        margin-bottom: 4px;
    }
    
    .company_detail p {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .card-plain {
        margin: 0;
        padding: 18px 15px;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
    
    .btn-round {
        border-radius: 25px;
    }
    
    /* Ensure form is centered on mobile */
    .authentication .col-lg-5 .card-plain {
        margin: 0 auto;
        max-width: 350px;
    }
    
    /* Reduce footer margin on mobile */
    .footer {
        margin-top: 12px;
    }
    
    /* Reduce input group margin on mobile */
    .input-group {
        margin-bottom: 0.8rem;
    }
    
    /* Reduce security notice margin on mobile */
    .security-notice {
        margin-bottom: 12px;
        padding: 6px;
        font-size: 10px;
    }
    
    /* Reduce card header margin on mobile */
    .card-plain .header h5 {
        margin-bottom: 12px;
    }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
    .authentication {
        padding: 15px;
    }
    
    .company_detail h4.logo {
        font-size: 1.8rem;
    }
    
    .company_detail h3 {
        font-size: 1.4rem;
    }
    
    .card-plain {
        max-width: 450px;
    }
}

/* Desktop adjustments */
@media (min-width: 1024px) {
    .authentication {
        padding: 20px;
    }
    
    .company_detail h4.logo {
        font-size: 2rem;
    }
    
    .company_detail h3 {
        font-size: 1.6rem;
    }
    
    .card-plain {
        max-width: 400px;
    }
}

/* Extra small devices */
@media (max-width: 575px) {
    .col-lg-5.offset-lg-1 {
        margin-left: 0;
    }
    
    .company_detail {
        padding: 6px;
    }
    
    .company_detail h4.logo {
        font-size: 1.3rem;
        margin-bottom: 4px;
    }
    
    .company_detail h3 {
        font-size: 1.1rem;
        margin-bottom: 3px;
    }
    
    .company_detail p {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .card-plain {
        margin: 0;
        padding: 15px 12px;
    }
    
    .authentication {
        padding: 0;
    }
    
    .authentication .content-center {
        padding-top: 3px;
    }
    
    /* Further reduce margins for very small screens */
    .footer {
        margin-top: 10px;
    }
    
    .input-group {
        margin-bottom: 0.6rem;
    }
    
    .security-notice {
        margin-bottom: 10px;
        padding: 5px;
        font-size: 9px;
    }
    
    .card-plain .header h5 {
        margin-bottom: 10px;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 767px) and (orientation: landscape) {
    .authentication {
        min-height: auto;
        padding: 0;
        align-items: center;
        justify-content: center;
    }
    
    .authentication .content-center {
        min-height: auto;
        align-items: center;
        justify-content: center;
        padding-top: 0;
    }
    
    .company_detail {
        margin-bottom: 8px;
    }
    
    .card-plain {
        padding: 12px;
    }
    
    .authentication .row {
        flex-direction: row;
        align-items: center;
    }
    
    .authentication .col-lg-6 {
        order: 1;
        margin-bottom: 0;
    }
    
    .authentication .col-lg-5 {
        order: 2;
    }
}

/* Print styles */
@media print {
    .security-notice,
    .btn,
    .link {
        display: none;
    }
    
    .card-plain {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .authentication {
        min-height: auto;
    }
}

/* Fix for iOS Safari */
@supports (-webkit-touch-callout: none) {
    .authentication {
        min-height: -webkit-fill-available;
    }
}

/* Fix for Android Chrome */
@media screen and (max-height: 600px) {
    .authentication {
        min-height: auto;
        padding: 0;
        align-items: center;
        justify-content: center;
    }
    
    .authentication .content-center {
        min-height: auto;
        align-items: center;
        justify-content: center;
        padding-top: 0;
    }
    
    .company_detail {
        margin-bottom: 6px;
    }
    
    .card-plain {
        padding: 10px;
    }
}

/* Specific mobile height fixes */
@media screen and (max-height: 700px) and (max-width: 767px) {
    .authentication {
        align-items: flex-start;
        justify-content: flex-start;
        padding-top: 0;
    }
    
    .authentication .content-center {
        align-items: flex-start;
        justify-content: flex-start;
        padding-top: 0;
    }
    
    .company_detail {
        margin-bottom: 8px;
    }
    
    .card-plain {
        margin-top: 0;
    }
}

/* Ensure proper spacing on very small screens */
@media screen and (max-width: 360px) {
    .authentication {
        padding: 0;
    }
    
    .card-plain {
        padding: 12px 8px;
    }
    
    .company_detail {
        padding: 4px 2px;
    }
    
    .company_detail h4.logo {
        font-size: 1.1rem;
        margin-bottom: 4px;
    }
    
    .company_detail h3 {
        font-size: 0.9rem;
        margin-bottom: 2px;
    }
    
    .company_detail p {
        font-size: 11px;
        margin-bottom: 4px;
    }
    
    .footer {
        margin-top: 8px;
    }
    
    .input-group {
        margin-bottom: 0.5rem;
    }
    
    .security-notice {
        margin-bottom: 8px;
        padding: 4px;
        font-size: 8px;
    }
    
    .card-plain .header h5 {
        margin-bottom: 8px;
    }
}

/* Ultra compact for very small heights */
@media screen and (max-height: 500px) and (max-width: 767px) {
    .authentication {
        padding: 0;
        align-items: flex-start;
        justify-content: flex-start;
    }
    
    .authentication .content-center {
        padding-top: 0;
    }
    
    .company_detail {
        padding: 4px;
        margin-bottom: 4px;
    }
    
    .company_detail h4.logo {
        font-size: 1rem;
        margin-bottom: 2px;
    }
    
    .company_detail h3 {
        font-size: 0.8rem;
        margin-bottom: 1px;
    }
    
    .company_detail p {
        font-size: 10px;
        margin-bottom: 2px;
    }
    
    .card-plain {
        padding: 10px 8px;
    }
    
    .footer {
        margin-top: 6px;
    }
    
    .input-group {
        margin-bottom: 0.4rem;
    }
    
    .security-notice {
        margin-bottom: 6px;
        padding: 3px;
        font-size: 7px;
    }
    
    .card-plain .header h5 {
        margin-bottom: 6px;
    }
} 