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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Main container */
.sv-client-login-container {
    flex: 1;
    display: flex;
    position: relative;
    background: #f8f9fa;
}

/* Back to Main Site Button */
.sv-back-to-main {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.sv-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(134, 178, 209, 0.2);
    border-radius: 12px;
    color: #002540;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sv-back-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    color: #86b2d1;
}

.sv-back-btn:active {
    transform: translateY(0);
}

/* Login section (Left) */
.sv-login-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: white;
}

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

/* Form logo */
.sv-form-logo {
    background-image: url('../img/sv_logo_2022_dark.svg');
    background-size: 400px 80px;
    background-repeat: no-repeat;
    height: 80px;
    width: 400px;
    padding-bottom: 30px;
    margin: 0 auto 30px;
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

/* Background section (Right Offcanvas) */
.sv-background-section {
    background-image: url('../img/international-box-background-e1676848338261.png') !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
    width: 35%;
    padding: 40px !important;
    margin-right: 0 !important;
    position: relative;
    overflow: hidden;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
}

.sv-background-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* Logo background */
.sv-logo-bg {
    background-image: url('../img/sv_logo_2022-light.svg') !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: top left;
    width: 200px;
    height: 100px;
    position: absolute;
    top: 40px;
    left: 40px;
    z-index: 2;
    animation: logoPulse 4s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

/* Logo container in background section */
.sv-logo-container {
    position: relative;
    z-index: 3;
    text-align: center;
}

.sv-logo-container img {
    max-width: 200px;
    height: auto;
    filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%);
}

/* Form wrapper */
.sv-login-form-wrapper h2 {
    color: #002540;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
    animation: titleSlideIn 0.8s ease-out;
    white-space: nowrap;
}

@keyframes titleSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sv-subtitle {
    color: #6b7280;
    font-size: 20px;
    text-align: center;
    margin-bottom: 40px;
    animation: subtitleSlideIn 0.8s ease-out 0.2s both;
}

@keyframes subtitleSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form styles */
.sv-login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: formSlideIn 0.8s ease-out 0.4s both;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

@keyframes formSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sv-form-group {
    position: relative;
}

.sv-form-group label {
    display: block;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.sv-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sv-input-icon {
    position: absolute;
    left: 16px;
    color: #9ca3af;
    z-index: 2;
    transition: all 0.3s ease;
}

.sv-input-status {
    position: absolute;
    right: 16px;
    display: flex;
    align-items: center;
    z-index: 2;
}

.sv-status-icon {
    opacity: 0;
    transition: all 0.3s ease;
    transform: scale(0.8);
}

.sv-status-icon.show {
    opacity: 1;
    transform: scale(1);
}

.sv-valid-icon {
    color: #10b981;
}

.sv-error-icon {
    color: #ef4444;
}

.sv-form-group input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f9fafb;
}

.sv-form-group input:focus {
    outline: none;
    border-color: #86b2d1;
    background: white;
    box-shadow: 0 0 0 4px rgba(134, 178, 209, 0.1);
    transform: translateY(-1px);
}

.sv-form-group input.valid {
    border-color: #10b981;
    background: #f0fdf4;
}

.sv-form-group input.valid:focus {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.sv-form-group input.error {
    border-color: #ef4444;
    background: #fef2f2;
    animation: shake 0.5s ease-in-out;
}

.sv-form-group input.error:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.sv-form-group input::placeholder {
    color: #9ca3af;
    transition: color 0.3s ease;
}

.sv-form-group input:focus::placeholder {
    color: #86b2d1;
}

/* Message styles - Now positioned above input */
.sv-message {
    margin-bottom: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    animation: messageSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.sv-message.success {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    border-left-color: #10b981;
}

.sv-message.error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border-left-color: #ef4444;
}

/* Submit button */
.sv-submit-btn {
    background: linear-gradient(135deg, #86b2d1 0%, #6b9bc3 100%);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.sv-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.sv-submit-btn:hover::before {
    left: 100%;
}

.sv-submit-btn:hover {
    background: linear-gradient(135deg, #7aa3c0 0%, #5a8ab0 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(134, 178, 209, 0.4);
}

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

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

/* Footer text */
.sv-footer-text {
    margin-top: 30px;
    text-align: center;
    animation: footerSlideIn 0.8s ease-out 0.6s both;
}

@keyframes footerSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sv-footer-text p {
    color: #6b7280;
    font-size: 14px;
}

.sv-support-link {
    color: #86b2d1;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid transparent;
}

.sv-support-link:hover {
    color: #002540;
    border-bottom-color: #002540;
    transform: translateY(-1px);
}

.sv-support-link:active {
    transform: translateY(0);
}

/* Loading spinner */
.sv-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

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

/* Responsive design */
@media (max-width: 1200px) {
    .sv-background-section {
        width: 40%;
        min-width: 350px;
    }
}

/* Tablet and Mobile Landscape */
@media (max-width: 1024px) {
    .sv-client-login-container {
        flex-direction: column;
        min-height: 100vh;
    }
    
    .sv-back-to-main {
        position: fixed;
        top: 20px;
        left: 20px;
        margin: 0;
        text-align: left;
        width: fit-content;
        z-index: 1000;
    }
    
    .sv-login-section {
        padding: 40px 30px;
        order: 1;
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .sv-background-section {
        width: 100%;
        min-width: auto;
        height: 250px;
        order: 2;
        padding: 30px !important;
    }
    
    .sv-login-content {
        max-width: 100%;
        width: 100%;
    }
    
    .sv-form-logo {
        background-size: 300px 60px;
        height: 60px;
        width: 300px;
        margin: 0 auto 20px;
    }
    
    .sv-login-form-wrapper h2 {
        font-size: 24px;
        white-space: normal;
        line-height: 1.3;
    }
    
    .sv-subtitle {
        font-size: 18px;
        line-height: 1.4;
    }
    
    .sv-login-form {
        max-width: 450px;
    }
}

/* Mobile Portrait */
@media (max-width: 768px) {
    .sv-client-login-container {
        flex-direction: column;
        min-height: 100vh;
    }
    
    .sv-back-to-main {
        position: fixed;
        top: 15px;
        left: 15px;
        margin: 0;
        text-align: left;
        width: fit-content;
        z-index: 1000;
    }
    
    .sv-back-btn {
        padding: 10px 14px;
        font-size: 13px;
        gap: 6px;
    }
    
    .sv-login-section {
        padding: 30px 20px;
        order: 1;
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .sv-background-section {
        width: 100%;
        min-width: auto;
        height: 200px;
        order: 2;
        padding: 20px !important;
    }
    
    .sv-login-content {
        max-width: 100%;
        width: 100%;
    }
    
    .sv-form-logo {
        background-size: 250px 50px;
        height: 50px;
        width: 250px;
        margin: 0 auto 15px;
    }
    
    .sv-login-form-wrapper h2 {
        font-size: 22px;
        white-space: normal;
        line-height: 1.3;
        margin-bottom: 6px;
    }
    
    .sv-subtitle {
        font-size: 16px;
        line-height: 1.4;
        margin-bottom: 30px;
    }
    
    .sv-login-form {
        max-width: 100%;
        gap: 20px;
    }
    
    .sv-form-group {
        margin-bottom: 0;
    }
    
    .sv-form-group label {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .sv-form-group input {
        padding: 14px 16px 14px 48px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .sv-submit-btn {
        padding: 16px 24px;
        font-size: 16px;
        min-height: 52px;
    }
    
    .sv-footer-text {
        margin-top: 25px;
    }
    
    .sv-footer-text p {
        font-size: 13px;
        line-height: 1.5;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .sv-client-login-container {
        min-height: 100vh;
    }
    
    .sv-back-to-main {
        position: fixed;
        top: 10px;
        left: 10px;
        margin: 0;
        text-align: left;
        z-index: 1000;
    }
    
    .sv-back-btn {
        padding: 8px 12px;
        font-size: 12px;
        gap: 4px;
    }
    
    .sv-login-section {
        padding: 20px 16px;
        order: 1;
    }
    
    .sv-background-section {
        height: 150px;
        padding: 15px !important;
        order: 2;
    }
    
    .sv-logo-bg {
        width: 120px;
        height: 60px;
        top: 20px;
        left: 20px;
    }
    
    .sv-form-logo {
        background-size: 200px 40px;
        height: 40px;
        width: 200px;
        margin: 0 auto 10px;
    }
    
    .sv-login-form-wrapper h2 {
        font-size: 20px;
        white-space: normal;
        line-height: 1.3;
        margin-bottom: 4px;
    }
    
    .sv-subtitle {
        font-size: 14px;
        line-height: 1.4;
        margin-bottom: 25px;
    }
    
    .sv-login-form {
        gap: 18px;
    }
    
    .sv-form-group input {
        padding: 12px 14px 12px 44px;
        font-size: 16px;
    }
    
    .sv-input-icon {
        width: 18px;
        height: 18px;
        left: 14px;
    }
    
    .sv-submit-btn {
        padding: 14px 20px;
        font-size: 15px;
        min-height: 48px;
    }
    
    .sv-footer-text {
        margin-top: 20px;
    }
    
    .sv-footer-text p {
        font-size: 12px;
    }
}

/* Extra Small Mobile */
@media (max-width: 360px) {
    .sv-back-to-main {
        position: fixed;
        top: 8px;
        left: 8px;
        margin: 0;
        text-align: left;
        z-index: 1000;
    }
    
    .sv-login-section {
        padding: 15px 12px;
        order: 1;
    }
    
    .sv-background-section {
        height: 120px;
        padding: 12px !important;
        order: 2;
    }
    
    .sv-logo-bg {
        width: 100px;
        height: 50px;
        top: 15px;
        left: 15px;
    }
    
    .sv-form-logo {
        background-size: 180px 36px;
        height: 36px;
        width: 180px;
    }
    
    .sv-login-form-wrapper h2 {
        font-size: 18px;
    }
    
    .sv-subtitle {
        font-size: 13px;
        margin-bottom: 20px;
    }
    
    .sv-form-group input {
        padding: 10px 12px 10px 40px;
    }
    
    .sv-input-icon {
        width: 16px;
        height: 16px;
        left: 12px;
    }
    
    .sv-submit-btn {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .sv-client-login-container {
        flex-direction: row;
        min-height: 100vh;
    }
    
    .sv-login-section {
        flex: 1;
        order: 1;
        padding: 20px;
    }
    
    .sv-background-section {
        width: 40%;
        height: 100vh;
        order: 2;
        padding: 20px !important;
    }
    
    .sv-back-to-main {
        position: fixed;
        top: 15px;
        left: 15px;
        margin: 0;
    }
    
    .sv-form-logo {
        background-size: 200px 40px;
        height: 40px;
        width: 200px;
        margin: 0 auto 15px;
    }
    
    .sv-login-form-wrapper h2 {
        font-size: 18px;
        margin-bottom: 4px;
    }
    
    .sv-subtitle {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .sv-login-form {
        gap: 15px;
    }
    
    .sv-form-group input {
        padding: 10px 12px 10px 40px;
        font-size: 14px;
    }
    
    .sv-submit-btn {
        padding: 12px 18px;
        font-size: 14px;
        min-height: 40px;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .sv-form-logo {
        background-image: url('../img/sv_logo_2022_dark.svg');
    }
    
    .sv-logo-bg {
        background-image: url('../img/sv_logo_2022-light.svg') !important;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .sv-back-btn:hover {
        transform: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    .sv-submit-btn:hover {
        transform: none;
        box-shadow: 0 4px 12px rgba(134, 178, 209, 0.4);
    }
    
    .sv-support-link:hover {
        transform: none;
    }
    
    /* Increase touch targets */
    .sv-back-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .sv-submit-btn {
        min-height: 44px;
    }
    
    .sv-form-group input {
        min-height: 44px;
    }
}

/* Smooth animations */
.sv-login-section {
    animation: slideInLeft 0.6s ease-out;
}

.sv-background-section {
    animation: slideInRight 0.6s ease-out;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Focus states for accessibility */
.sv-submit-btn:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(134, 178, 209, 0.3);
}

.sv-form-group input:focus + .sv-input-icon {
    color: #86b2d1;
}

/* Modern validation states */
.sv-form-group.validating input {
    border-color: #f59e0b;
    background: #fffbeb;
}

.sv-form-group.validating .sv-input-icon {
    color: #f59e0b;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

