/* CSS for Shop Login Modal */
.pdc-shop-login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000; /* High z-index to be on top */
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    font-family: Arial, sans-serif;
}

.pdc-shop-login-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
}

.pdc-shop-login-content {
    position: relative;
    background-color: #fff;
    padding: 25px 30px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
    text-align: center;
    z-index: 10001;
    overflow: hidden; /* For loader transition */
}

.pdc-shop-login-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
}
.pdc-shop-login-close:hover {
    color: #777;
}

.pdc-shop-login-view {
    display: none;
}
.pdc-shop-login-view.active {
    display: block;
}

.pdc-shop-login-content h3 {
    font-size: 1.6em;
    color: #333;
    margin-top: 0;
    margin-bottom: 15px;
}
.pdc-shop-login-content p {
    font-size: 0.95em;
    color: #666;
    margin-bottom: 20px;
}

#pdc-login-pin-phone-display {
    font-weight: bold;
    color: var(--pdc-shop-primary-color, #ee4d2d);
}

.pdc-shop-login-content input[type="tel"],
.pdc-shop-login-content input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1.1em;
    box-sizing: border-box;
    text-align: center;
}
.pdc-shop-login-content input[type="password"]#pdc-login-pin-visual {
    letter-spacing: 0.5em; /* For PIN display */
    font-size: 1.5em; /* Make PIN stars larger */
    background-color: #f9f9f9;
    border-color: #ccc;
    pointer-events: none; /* Not directly editable */
}


.pdc-shop-login-button {
    background-color: var(--pdc-shop-primary-color, #ee4d2d);
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}
.pdc-shop-login-button:hover {
    background-color: var(--pdc-shop-primary-dark, #d44224);
}
.pdc-shop-login-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#pdc-login-pin-register {
    background-color: #28a745; /* Green for register */
}
#pdc-login-pin-register:hover {
    background-color: #218838;
}


.pdc-pin-display-container {
    margin-bottom: 20px;
}

.pdc-pin-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.pdc-pin-pad button {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 50%; /* Circular buttons */
    font-size: 1.5em; /* Larger digits */
    font-weight: bold;
    color: #555;
    cursor: pointer;
    padding: 15px 0; /* Adjust for height */
    height: 60px; /* Fixed height */
    width: 60px;  /* Fixed width */
    margin: auto; /* Center in grid cell */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.pdc-pin-pad button:hover {
    background-color: #e0e0e0;
}
.pdc-pin-pad button:active {
    background-color: #d0d0d0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.pdc-pin-pad button[data-action="clear"],
.pdc-pin-pad button[data-action="backspace"] {
    font-size: 1.2em; /* Slightly smaller for action buttons */
    background-color: #e9ecef;
}
.pdc-pin-pad button[data-action="clear"]:hover,
.pdc-pin-pad button[data-action="backspace"]:hover {
    background-color: #d6dade;
}

.pdc-shop-login-message {
    margin-top: 15px;
    font-size: 0.9em;
    color: var(--pdc-shop-error-color, #e74c3c);
    min-height: 1.2em; /* Prevent layout shift */
    display: none; /* Hidden by default */
}
.pdc-shop-login-message.success {
    color: var(--pdc-shop-success-color, #27ae60);
}

.pdc-login-change-phone-link {
    display: block;
    margin-top: 15px;
    font-size: 0.9em;
    color: var(--pdc-shop-primary-color, #ee4d2d);
    text-decoration: none;
}
.pdc-login-change-phone-link:hover {
    text-decoration: underline;
}

/* Loader Styles */
.pdc-shop-login-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10; /* Above form views */
}
.pdc-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--pdc-shop-primary-color, #ee4d2d);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: pdc-spin 1s linear infinite;
    margin-bottom: 15px;
}
#pdc-login-loader-text {
    font-size: 1em;
    color: #555;
}

@keyframes pdc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Body class when modal is open */
body.pdc-modal-open {
    overflow: hidden;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .pdc-shop-login-content {
        padding: 20px;
        width: 95%;
    }
    .pdc-shop-login-content h3 {
        font-size: 1.4em;
    }
    .pdc-pin-pad button {
        font-size: 1.3em;
        height: 50px;
        width: 50px;
        padding: 10px 0;
    }
}
