/**
 * Twilio Bridge Connect Styles.
 *
 * @package TwilioBridgeConnect
 */

#tbc-form-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 40px;
    border: 1px solid #eee;
    border-radius: 12px;
    background-color: #ffffff;
    box-shadow: none;
    overflow: hidden;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    text-align: center; /* Reverted to center for container */
}

.tbc-steps-wrapper {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.tbc-step {
    min-width: 100%;
    width: 100%;
    box-sizing: border-box;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center; /* Reverted to center items */
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.tbc-step.active {
    opacity: 1;
}

#tbc-connect-form label {
    display: block;
    margin-bottom: 30px;
    font-weight: 700;
    font-size: 32px;
    line-height: 1.2;
    color: var(--tbc-secondary-color, #0E2119);
    width: 100%;
    text-align: center; /* Reverted to center for questions */
}

/* Error Text Styling */
.tbc-step-error {
    color: #dc3545;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #fff5f5;
    border-radius: 6px;
    border-left: 4px solid #dc3545;
    display: none;
    width: 100%;
    max-width: 500px;
    box-sizing: border-box;
    text-align: center;
}

/* Selection Grid for Step 1 */
.tbc-selection-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
}

.tbc-selection-box {
    border: 2px solid #ddd;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center; /* Selection boxes remain centered for visual balance */
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tbc-selection-box:hover {
    border-color: var(--tbc-primary-color, #ACCA47);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.tbc-selection-box.selected {
    border-color: var(--tbc-primary-color, #ACCA47);
    background-color: rgba(172, 202, 71, 0.05);
}

.tbc-selection-box .tbc-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
    color: var(--tbc-primary-color, #ACCA47);
}

.tbc-selection-box .tbc-icon svg {
    width: 100%;
    height: 100%;
}

.tbc-selection-box h3 {
    margin: 0 0 10px 0;
    font-size: 22px;
    color: var(--tbc-secondary-color, #0E2119);
}

.tbc-selection-box p {
    margin: 0;
    font-size: 15px;
    color: #666;
    line-height: 1.4;
}

/* Inputs - ONLY these should have left aligned text */
#tbc-connect-form input[type="text"],
#tbc-connect-form input[type="email"],
#tbc-connect-form input[type="tel"] {
    width: 100%;
    max-width: 500px;
    padding: 18px;
    margin-bottom: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 20px;
    transition: border-color 0.3s;
    text-align: left; /* ONLY input text and placeholders are left aligned */
}

#tbc-connect-form input:focus {
    border-color: var(--tbc-primary-color, #ACCA47);
    outline: none;
}

.tbc-address-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 500px;
}

.tbc-address-grid input {
    margin-bottom: 0 !important;
}

.tbc-navigation {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    justify-content: center; /* Reverted to center buttons */
    width: 100%;
}

#tbc-connect-form button {
    padding: 18px 40px;
    background-color: var(--tbc-primary-color, #ACCA47);
    color: var(--tbc-secondary-color, #0E2119);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    font-weight: 700;
    transition: background-color 0.3s, opacity 0.3s;
}

#tbc-connect-form button:hover {
    opacity: 0.9;
}

#tbc-connect-form button.tbc-prev-btn {
    background-color: #f0f0f0;
    color: #0E2119;
}

/* Looping Messages */
#tbc-loop-messages {
    text-align: center; /* Reverted to center */
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tbc-loop-msg {
    display: none;
    font-size: 28px;
    font-weight: 700;
    color: var(--tbc-secondary-color, #0E2119);
}

.tbc-loop-msg.active {
    display: block;
    animation: fadeInOut 3s infinite;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(10px); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-10px); }
}

.tbc-loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--tbc-primary-color, #ACCA47);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 30px auto; /* Re-centered */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#tbc-message {
    margin-top: 30px;
    padding: 20px;
    border-radius: 8px;
    text-align: center; /* Re-centered */
    font-size: 18px;
}

#tbc-message.success {
    background-color: #f7faed;
    color: #0E2119;
    border: 1px solid var(--tbc-primary-color, #ACCA47);
}

.tbc-input-error {
    border-color: #dc3545 !important;
    background-color: #fff8f8;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    #tbc-form-container {
        margin: 10px;
        padding: 20px;
    }

    #tbc-connect-form label {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .tbc-selection-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    #tbc-connect-form button {
        width: 100%;
    }

    .tbc-navigation {
        flex-direction: column-reverse;
        gap: 10px;
    }
}
