/* MyCare Login Page Styles */

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

/* Session Expired Alert */
.inactivity-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    max-width: 500px;
    width: 90%;
    background: #d1ecf1;
    color: #0c5460;
    padding: 12px 20px;
    border-radius: 6px;
    border: 1px solid #bee5eb;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-size: 14px;
}

/* Staging Alert */
.staging-alert {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #d1ecf1;
    color: #0c5460;
    padding: 12px 20px;
    text-align: center;
    font-size: 14px;
    border-bottom: 1px solid #bee5eb;
    z-index: 9998;
    word-wrap: break-word;
}

.staging-alert a {
    color: #0c5460;
    font-weight: 600;
    text-decoration: underline;
}

/* Main Container */
.login-container {
    display: flex;
    width: 100%;
    max-width: 1400px;
    min-height: 100vh;
    background: white;
}

/* Left Side - Login Form */
.login-left {
    flex: 0 0 45%;
    padding: 60px 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: white;
}

.login-content {
    max-width: 450px;
    margin: 0 auto;
    width: 100%;
}

/* Logo */
.logo-container {
    margin-bottom: 50px;
}

.logo-img {
    max-width: 280px;
    height: auto;
}

/* Header */
.login-header {
    margin-bottom: 35px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

/* Form */
.login-form {
    width: 100%;
}

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

.form-label-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
    margin: 0;
}

.forgot-link {
    font-size: 14px;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: #d32f2f;
}

.form-input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    transition: all 0.2s;
    background: white;
    color: #1f2937;
}

.form-input:focus {
    outline: none;
    border-color: #d32f2f;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #6b7280;
    background: none;
    border: none;
    padding: 4px;
    font-size: 18px;
    display: flex;
    align-items: center;
}

.password-toggle:hover {
    color: #374151;
}

/* Remember Me */
.remember-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.remember-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #d32f2f;
}

.remember-label {
    font-size: 14px;
    color: #4a5568;
    cursor: pointer;
    margin: 0;
    user-select: none;
}

/* Login Button */
.login-button {
    width: 100%;
    padding: 14px 24px;
    background: #d32f2f;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.login-button:hover:not(:disabled) {
    background: #b71c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.3);
}

.login-button:active:not(:disabled) {
    transform: translateY(0);
}

.login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.button-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

.login-button.loading .button-spinner {
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* SSO Link */
.sso-wrapper {
    text-align: center;
    margin-top: 20px;
}

.sso-link {
    font-size: 14px;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}

.sso-link:hover {
    color: #d32f2f;
    text-decoration: underline;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 6px;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-danger {
    background-color: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-content {
    flex: 1;
}

.alert-close {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.alert-close:hover {
    opacity: 1;
}

/* Footer */
.login-footer {
    margin-top: 60px;
    text-align: center;
}

.copyright {
    font-size: 13px;
    color: #6b7280;
}

/* Right Side - Carousel */
.login-right {
    flex: 1;
    background: #f8f9fa;
    position: relative;
    overflow: hidden;
}

.carousel {
    width: 100%;
    height: 100%;
}

.carousel-inner {
    height: 100%;
}

.carousel-item {
    height: 100%;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hide carousel controls (optional) */
.carousel-control-prev,
.carousel-control-next {
    display: none;
}

/* Carousel indicators styling (optional) */
.carousel-indicators {
    bottom: 20px;
}

.carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
}

.carousel-indicators button.active {
    background-color: white;
}

/* Eye icon styles */
.eye-icon {
    width: 20px;
    height: 20px;
}

/* Responsive */

/* Large Tablets and Small Desktops (1024px - 1200px) */
@media (max-width: 1200px) {
    .login-container {
        max-width: 100%;
    }

    .login-left {
        flex: 0 0 50%;
        padding: 50px 60px;
    }
}

/* Tablets (768px - 1024px) */
@media (max-width: 1024px) {
    .login-left {
        flex: 0 0 50%;
        padding: 40px 50px;
    }

    .login-content {
        max-width: 400px;
    }

    .logo-img {
        max-width: 240px;
    }

    .login-header h1 {
        font-size: 26px;
    }
}

/* Small Tablets (600px - 768px) */
@media (max-width: 768px) {
    body {
        align-items: flex-start;
    }

    .login-container {
        flex-direction: column;
        min-height: 100vh;
        max-width: 100%;
    }

    .login-left {
        flex: 1 1 auto;
        padding: 30px 40px;
        min-height: auto;
    }

    .login-content {
        max-width: 100%;
    }

    .login-right {
        flex: 0 0 auto;
        min-height: 250px;
        max-height: 300px;
        order: -1; /* Show carousel on top */
    }

    .logo-container {
        margin-bottom: 30px;
        text-align: center;
    }

    .logo-img {
        max-width: 200px;
    }

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

    .login-header h1 {
        font-size: 24px;
    }

    .login-footer {
        margin-top: 40px;
    }

    .carousel-indicators {
        bottom: 10px;
    }

    .carousel-indicators button {
        width: 8px;
        height: 8px;
    }

    /* Adjust alerts for tablets */
    .inactivity-message {
        top: 10px;
        font-size: 13px;
        padding: 10px 15px;
    }

    .staging-alert {
        font-size: 13px;
        padding: 10px 15px;
    }
}

/* Mobile Devices (480px - 600px) */
@media (max-width: 600px) {
    .login-left {
        padding: 25px 30px;
    }

    .logo-img {
        max-width: 180px;
    }

    .login-header h1 {
        font-size: 22px;
    }

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

    .form-input {
        padding: 12px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .form-label {
        font-size: 13px;
    }

    .forgot-link {
        font-size: 13px;
    }

    .login-button {
        padding: 13px 20px;
        font-size: 15px;
    }

    .remember-wrapper {
        margin-bottom: 20px;
    }

    .remember-label {
        font-size: 13px;
    }

    .sso-link {
        font-size: 13px;
    }

    .login-footer {
        margin-top: 30px;
    }

    .copyright {
        font-size: 12px;
    }

    .login-right {
        min-height: 200px;
        max-height: 250px;
    }
}

/* Small Mobile Devices (320px - 480px) */
@media (max-width: 480px) {
    body {
        background-color: white;
    }

    .login-container {
        box-shadow: none;
    }

    .login-left {
        padding: 20px;
    }

    .logo-container {
        margin-bottom: 25px;
    }

    .logo-img {
        max-width: 160px;
    }

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

    .login-header h1 {
        font-size: 20px;
    }

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

    .form-input {
        padding: 11px 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .form-label-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        margin-bottom: 6px;
    }

    .forgot-link {
        font-size: 12px;
    }

    .password-toggle {
        right: 10px;
        padding: 6px;
    }

    .eye-icon {
        width: 18px;
        height: 18px;
    }

    .remember-wrapper {
        margin-bottom: 18px;
    }

    .login-button {
        padding: 12px 18px;
        font-size: 15px;
    }

    .sso-wrapper {
        margin-top: 16px;
    }

    .sso-link {
        font-size: 12px;
    }

    .login-footer {
        margin-top: 25px;
    }

    .copyright {
        font-size: 11px;
    }

    .login-right {
        min-height: 180px;
        max-height: 200px;
    }

    .alert {
        padding: 10px 12px;
        font-size: 13px;
        gap: 8px;
    }

    .alert-close {
        width: 18px;
        height: 18px;
        font-size: 18px;
    }

    .inactivity-message {
        top: 10px;
        font-size: 12px;
        padding: 8px 12px;
        width: 95%;
    }

    .staging-alert {
        font-size: 11px;
        padding: 8px 12px;
        line-height: 1.4;
    }
}

/* Very Small Devices (up to 360px) */
@media (max-width: 360px) {
    .login-left {
        padding: 15px;
    }

    .logo-img {
        max-width: 140px;
    }

    .login-header h1 {
        font-size: 18px;
    }

    .form-input {
        padding: 10px;
        font-size: 16px;
    }

    .login-button {
        padding: 11px 16px;
        font-size: 14px;
    }

    .login-right {
        min-height: 150px;
        max-height: 180px;
    }
}

/* Landscape Orientation for Mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .login-container {
        flex-direction: row;
    }

    .login-left {
        flex: 1;
        order: 0;
        overflow-y: auto;
        padding: 20px 30px;
    }

    .login-right {
        flex: 0 0 40%;
        order: 1;
        min-height: 100vh;
        max-height: none;
    }

    .logo-container {
        margin-bottom: 15px;
    }

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

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

    .remember-wrapper {
        margin-bottom: 12px;
    }

    .login-footer {
        margin-top: 20px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .form-input {
        font-size: 16px; /* Prevents auto-zoom on iOS */
    }

    .login-button,
    .forgot-link,
    .sso-link,
    .password-toggle {
        min-height: 44px; /* Apple recommended touch target size */
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .password-toggle {
        min-width: 44px;
    }

    .remember-checkbox {
        width: 20px;
        height: 20px;
    }
}
