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

body {
    font-family: Arial, sans-serif;
    background: #DC143C;
    height: 100vh;
    overflow: hidden;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.atm-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    background: #DC143C;
    font-family: Arial, sans-serif;
    overflow: hidden;
    padding: 10px;
    gap: 10px;
    position: relative;
}

/* Background slideshow styles */
.background-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.background-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.background-slide.active {
    opacity: 0.7; /* 30% transparency = 70% opacity */
}

.background-slide:nth-child(1) {
    animation: slideshow 10s infinite;
}

.background-slide:nth-child(2) {
    animation: slideshow 10s infinite 5s;
}

@keyframes slideshow {
    0%, 45% { opacity: 0.7; }
    50%, 95% { opacity: 0; }
    100% { opacity: 0; }
}

/* Background fixed styles */
.background-fixed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.background-image-fixed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 1.0; /* 0% transparency = 100% opacity */
}

.screen-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #DC143C;
    position: relative;
    max-width: calc(100% - 250px);
    z-index: 2; /* Ensure screen content appears above background */
}

.screen-header {
    background: #DC143C;
    color: black;
    padding: 15px 20px;
    font-weight: bold;
    font-size: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-name {
    font-size: 20px;
    font-weight: bold;
}

.screen-content {
    flex: 1;
    background: linear-gradient(135deg, #FFB6C1 0%, #FFC0CB 100%);
    border: 3px solid #4169E1;
    border-radius: 15px;
    margin: 10px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

/* Menu Buttons for Initial Page */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 25px;
    align-items: flex-end;
    padding: 20px;
    width: 100%;
    position: relative;
    z-index: 3;
}

.menu-option {
    background: rgba(255, 100, 100, 0.9);
    border: none;
    border-radius: 30px;
    padding: 18px 50px;
    font-size: 18px;
    font-weight: bold;
    color: black;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 280px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    text-align: center;
}

.menu-option:hover {
    background: rgba(255, 80, 80, 1);
    transform: scale(1.02);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

/* Login Layout */
.login-layout {
    display: flex;
    width: 100%;
    height: 100%;
    padding: 20px;
    gap: 30px;
}

.fingerprint-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fingerprint-box {
    width: 120px;
    height: 150px;
    background: #8B0000;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.fingerprint-icon {
    font-size: 60px;
    color: #FFB6C1;
}

.info-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    justify-content: center;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.label {
    font-size: 18px;
    font-weight: bold;
    color: black;
    min-width: 100px;
}

.input-field {
    background: rgba(255, 150, 150, 0.9);
    border: 3px solid #0066CC;
    border-radius: 20px;
    padding: 15px 20px;
    font-size: 16px;
    color: black;
    min-width: 250px;
    text-align: center;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.input-field:hover {
    background: rgba(255, 130, 130, 1);
    border-color: #0088FF;
}

.input-field.active {
    background: rgba(255, 200, 200, 1);
    border-color: #00AA00;
    box-shadow: 0 0 10px rgba(0, 170, 0, 0.5);
}

/* Card Layout */
.card-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 40px;
    justify-content: center;
}

.obs-text {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 14px;
    font-weight: bold;
    color: #999;
    line-height: 1.2;
}

/* QR Layout */
.qr-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-align: center;
}

.qr-title {
    font-size: 48px;
    font-weight: bold;
    color: black;
    margin-bottom: 30px;
}

.qr-instruction {
    font-size: 16px;
    color: black;
    line-height: 1.4;
}

/* Main Menu Layout */
.main-menu-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 40px;
}

.menu-option.sair {
    margin-top: 40px;
}

/* Amount Buttons Layout */
.saque-layout, .deposito-layout {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 60px 40px;
    padding-right: 20px;
}

.amount-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: flex-end;
    width: 100%;
}

.amount-option {
    background: rgba(255, 100, 100, 0.9);
    border: none;
    border-radius: 30px;
    padding: 18px 40px;
    font-size: 18px;
    font-weight: bold;
    color: black;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 280px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    text-align: center;
}

.amount-option:hover {
    background: rgba(255, 80, 80, 1);
    transform: scale(1.02);
}

.amount-option.selected {
    border: 4px solid #0066CC;
    background: rgba(255, 120, 120, 1);
}

.amount-option.voltar {
    margin-top: 30px;
}

/* Saldo Layout */
.saldo-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 60px 40px;
}

.saldo-display {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.saldo-header {
    background: rgba(150, 100, 255, 0.9);
    border: 3px solid #0066CC;
    padding: 20px;
    font-size: 18px;
    font-weight: bold;
    color: black;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.saldo-amount {
    font-size: 28px;
    font-weight: bold;
    color: black;
    margin: 20px 0;
}

/* Comprovante Layout */
.comprovante-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 60px 40px;
}

.comprovante-question {
    font-size: 28px;
    font-weight: bold;
    color: black;
    text-align: center;
    margin-bottom: 60px;
    line-height: 1.3;
}

.via-buttons {
    display: flex;
    flex-direction: column;
    gap: 25px;
    align-items: flex-end;
    width: 100%;
    padding-right: 20px;
}

.via-option {
    background: rgba(255, 100, 100, 0.9);
    border: none;
    border-radius: 30px;
    padding: 18px 50px;
    font-size: 18px;
    font-weight: bold;
    color: black;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 280px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    text-align: center;
}

.via-option:hover {
    background: rgba(255, 80, 80, 1);
    transform: scale(1.02);
}

/* QR Code Layout */
.qr-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 40px;
    text-align: center;
}

.qr-image {
    width: 200px;
    height: 200px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Obrigado Layout */
.obrigado-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 60px 40px;
    text-align: center;
}

.obrigado-message {
    font-size: 28px;
    font-weight: bold;
    color: black;
    margin-bottom: 40px;
    line-height: 1.3;
}

.countdown-display {
    font-size: 24px;
    color: #DC143C;
    margin-bottom: 30px;
    font-weight: bold;
    text-align: center;
}

.outra-option {
    background: rgba(255, 100, 100, 0.9);
    border: none;
    border-radius: 30px;
    padding: 18px 50px;
    font-size: 18px;
    font-weight: bold;
    color: black;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 280px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    text-align: center;
    align-self: flex-end;
    margin-right: 20px;
}

.outra-option:hover {
    background: rgba(255, 80, 80, 1);
    transform: scale(1.02);
}

/* Instructions */
.instructions {
    background: rgba(255, 255, 255, 0.9);
    padding: 15px 25px;
    border-radius: 10px;
    border: 2px solid #4169E1;
    margin: 10px 20px;
    text-align: center;
    font-size: 14px;
    color: #333;
    position: relative;
    z-index: 3;
}

/* Side Buttons */
.side-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 200px;
    padding: 20px 10px;
    z-index: 2; /* Ensure side buttons appear above background */
    position: relative;
    background: #DC143C;
}

.side-btn {
    padding: 15px 8px;
    background: #B0B0B0;
    color: black;
    border: none;
    border-radius: 3px;
    font-weight: bold;
    font-size: 9px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
}

.side-btn:hover {
    background: #D0D0D0;
    transform: translateX(-2px);
}

.side-btn:active {
    background: #A0A0A0;
    transform: translateX(0);
}

/* Keypad */
.keypad {
    background: #B0B0B0;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-radius: 8px;
    width: 200px;
    flex-shrink: 0;
    z-index: 2; /* Ensure keypad appears above background */
    position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.keypad-row {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.key {
    width: 32px;
    height: 32px;
    background: #E0E0E0;
    color: black;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.key:hover {
    background: #F0F0F0;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

.key:active {
    background: #D0D0D0;
    transform: translateY(0);
}

.key.cancel {
    background: #DC143C;
    color: white;
    font-size: 8px;
    font-weight: bold;
}

.key.clear {
    background: #FF8C00;
    color: white;
    font-size: 8px;
    font-weight: bold;
}

.key.enter {
    background: #228B22;
    color: white;
    font-size: 8px;
    font-weight: bold;
}

.key.zero {
    width: 70px;
}

/* Loading Animation */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #DC143C;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

/* iPad 10-inch specific optimizations (1640x2360px) - Portrait mode */
@media screen and (min-width: 1600px) and (max-width: 1700px) and (min-height: 2300px) and (max-height: 2400px) {
    .atm-container {
        height: 100vh;
        width: 100vw;
        padding: 20px;
        gap: 20px;
    }
    
    .screen-container {
        max-width: calc(100% - 400px);
    }
    
    .screen-content {
        margin: 20px 30px;
        border-radius: 20px;
        border-width: 4px;
    }
    
    .menu-buttons {
        padding: 40px;
        gap: 35px;
    }
    
    .menu-option {
        padding: 25px 70px;
        font-size: 24px;
        border-radius: 40px;
    }
    
    .side-buttons {
        width: 300px;
        padding: 30px 20px;
        gap: 20px;
    }
    
    .side-btn {
        padding: 20px 12px;
        font-size: 16px;
        border-radius: 8px;
        min-height: 80px;
    }
    
    .keypad {
        width: 300px;
        padding: 20px;
        border-radius: 12px;
    }
    
    .keypad-row {
        gap: 12px;
        margin-bottom: 12px;
    }
    
    .key {
        width: 60px;
        height: 60px;
        font-size: 20px;
        border-radius: 8px;
    }
    
    .key.zero {
        width: 132px;
    }
    
    .key.cancel, .key.clear, .key.enter {
        font-size: 14px;
        font-weight: bold;
    }
    
    .instructions {
        padding: 20px 35px;
        margin: 15px 30px;
        font-size: 18px;
        border-radius: 15px;
        border-width: 3px;
    }
    
    .screen-header {
        padding: 20px 30px;
        font-size: 22px;
    }
    
    .page-name {
        font-size: 24px;
    }
    
    /* Specific adjustments for amount buttons */
    .amount-buttons {
        gap: 20px;
        padding: 30px;
    }
    
    .amount-option {
        padding: 20px 40px;
        font-size: 20px;
        border-radius: 25px;
        min-width: 180px;
    }
    
    /* Background image adjustments */
    .background-slideshow,
    .background-fixed {
        border-radius: 20px;
    }
    
    /* Login layout adjustments */
    .login-layout {
        padding: 30px;
        gap: 25px;
    }
    
    .fingerprint-box {
        width: 120px;
        height: 120px;
    }
    
    .fingerprint-icon {
        font-size: 60px;
    }
    
    .info-row {
        margin: 15px 0;
        font-size: 18px;
    }
    
    .input-field {
        padding: 15px 20px;
        font-size: 16px;
        border-radius: 8px;
        min-height: 50px;
    }
}
