html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Roboto", Sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.ewa-account-wrapper {
    flex: 1;
}

:root {
    --ewa-brand: #013B57;
    --ewa-muted: #D9EFFE;
    --ewa-bg: #FFFFFF;
    --ewa-radius: 30px;
}

/* Wrapper */
.ewa-account-wrapper {
    width: 1000px;
    max-width: 1100px;
    margin: 40px auto 0 280px;
}
.ewa-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}
.ewa-form-row .ewa-field {
    flex: 1 1 calc(50% - 10px);
}


.ewa-field.full-width {
    flex: 1 1 100%;
}
#ewa_new_password, #ewa_confirm_password {
    width: 100%;
}

/* Tabs */
.ewa-account-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
    gap: 10px;
}

.ewa-tab span {
    cursor: pointer;
}

/* Content */
.ewa-tab-content {
    display: none;
}
.ewa-tab-content.active {
    display: block;
}

.ewa-tab-content h2 {
    font-weight: 500 !important;
}

/* Fields */

.ewa-field {
    position: relative;
    margin: 30px 0;
}

.ewa-field input[readonly] {
    cursor: not-allowed;
}

.ewa-field select {
    width: 100%;
    padding: 12px 14px; 
    border-radius: 8px;
    background: #fff;
    font-size: 16px;
    color: #1e293b;
    appearance: none;
}

.ewa-field.select::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--ewa-brand);
    pointer-events: none;
    transition: border-top-color 0.3s;
}

.ewa-field label {
    position: absolute;
    top: 0;
    left: 12px;
    transform: translateY(-50%);
    background: white;
    padding: 0 8px;
    font-size: 14px;
    color: var(--ewa-brand);
    font-weight: 300;
    pointer-events: none;
    transition: all 0.3s;
    z-index: 1;
}
.ewa-field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--ewa-brand);
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    background: transparent;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.ewa-section-title {
    margin-top: 25px;
    font-size: 18px;
    font-weight: 700;
    color: var(--ewa-brand);
}

/* Buttons */
.ewa-btn {
    border-radius: var(--ewa-radius);
    padding: 5px 10px;
    cursor: pointer;
    font-weight: 400;
    font-size: 15px;
    border: none;
    transition: all 0.25s;
}
.ewa-btn-primary {
    font-size: 16px;
    padding: 12px 20px;
    background: var(--ewa-brand) !important;
    color: var(--ewa-bg) !important;
    transition: all 0.3s;
    text-decoration: none;
}
.ewa-btn-primary:hover {
    background: var(--ewa-muted) !important;
    color: var(--ewa-brand) !important;
    background-image: linear-gradient(180deg, #94BCD7 0%, #94BCD7 100%) !important;
    transition: all 0.3s;
}
.ewa-btn-primary.download {
    font-size: 15px;
    padding: 5px 10px;
}
.ewa-btn-ghost {
    background: var(--ewa-bg);
    color: var(--ewa-brand);
    border: 1px solid var(--ewa-brand);
    text-decoration: none;
}
.ewa-btn-ghost:hover {
    background: var(--ewa-brand);
    color: var(--ewa-bg);
}

/* Orders table */
.ewa-orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.ewa-orders-table th {
    font-size: 16px;
    font-weight: 500;
}

.ewa-orders-table th,
.ewa-orders-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--ewa-muted);
    text-align: center;
    color: var(--ewa-brand);
}

.ewa-orders-table tbody > tr td:first-child {
    text-align: left;
}

.ewa-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
}
.ewa-status-completed, .ewa-status-processing {
    background: #D9F7D9;
    color: #0A820A;
}
.ewa-status-pending, .ewa-status-on-hold {
    background: #FFF5C2;
    color: #A67A00;
}
.ewa-status-cancelled {
    background: #FFD9D9;
    color: #B41F1F;
}

.ewa-form-error {
    color: #b41f1f;
    font-size: 14px;
    margin-top: 10px;
    display: none;
}

.ewa-copy-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ewa-license-code {
    font-family: monospace;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    white-space: nowrap;
}

.ewa-copy-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ewa-copy-btn:hover {
    background: var(--ewa-muted);
}

.ewa-copy-btn.copied {
    background: #d4edda;
    color: #155724;
}

/* Иконка */
.ewa-copy-icon {
    width: 16px;
    height: 16px;
    stroke: #666;
    transition: stroke 0.3s;
}

.ewa-copy-btn:hover .ewa-copy-icon { 
    stroke: var(--ewa-brand); 
}

.ewa-copy-btn.copied .ewa-copy-icon {
    stroke: #28a745;
}

/* Анимация "галочка" при копировании */
.ewa-copy-btn.copied .ewa-copy-icon {
    stroke: #28a745;
}

/* Logout */
.ewa-logout {
    text-align: center;
}
.ewa-logout p {
    color: var(--ewa-brand);
    margin-bottom: 20px;
}

.ewa-success-message {
    display: none;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    opacity: 0;
    transition: opacity 0.5s ease;
}
.ewa-tab-content table thead,
.ewa-tab-content table tbody,
.ewa-tab-content table tr,
.ewa-tab-content table th,
.ewa-tab-content table td {
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 1100px) {
    .ewa-account-wrapper{
        width: unset;
        margin: 40px auto;
    }
}
@media (max-width: 768px) {
    .ewa-orders-table th,
    .ewa-orders-table td {
        font-size: 13px;
        padding: 8px;
    }
    .ewa-tab {
        padding: 8px 15px;
        font-size: 14px;
    }

    .ewa-form-row {
        flex-direction: column;
    }
    .ewa-form-row .ewa-field {
        flex: 1 1 100%;
    }
}

/* Orders table */
.ewa-orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.ewa-orders-table th,
.ewa-orders-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--ewa-muted);
    text-align: center;
    color: var(--ewa-brand);
}

/* Status badges */
.ewa-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
}

.ewa-status-completed, .ewa-status-processing {
    background: #D9F7D9;
    color: #0A820A;
}
.ewa-status-pending, .ewa-status-on-hold {
    background: #FFF5C2;
    color: #A67A00;
}
.ewa-status-cancelled {
    background: #FFD9D9;
    color: #B41F1F;
}


@media (max-width: 1100px) {
    .ewa-orders-table {
        display: block;
        overflow-x: auto;
        width: 100%;
        -webkit-overflow-scrolling: touch;
    }
    .ewa-orders-table,
    .ewa-orders-table thead,
    .ewa-orders-table tbody,
    .ewa-orders-table th,
    .ewa-orders-table td,
    .ewa-orders-table tr {
        display: block;
    }

    .ewa-orders-table thead tr {
        display: none; /* ховаємо заголовки колонок */
    }

    .ewa-orders-table tr {
        margin-bottom: 20px;
        border-bottom: 2px solid var(--ewa-muted);
        padding-bottom: 10px;
    }

    .ewa-orders-table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border: none;
    }

    .ewa-orders-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: 45%;
        text-align: left;
        font-weight: 600;
        color: var(--ewa-brand);
    }
}
